()
| 148 | } |
| 149 | |
| 150 | func (ph *PseudoHeader) Marshal() []byte { |
| 151 | buf := make([]byte, pseudoHeaderLen) |
| 152 | index := 0 |
| 153 | copy(buf, ph.SrcIP[:]) |
| 154 | index += 16 |
| 155 | copy(buf[index:], ph.DstIP[:]) |
| 156 | index += 16 |
| 157 | binary.BigEndian.PutUint32(buf[index:], ph.UpperLayerPacketLength) |
| 158 | index += 4 |
| 159 | copy(buf[index:], ph.zero[:]) |
| 160 | buf[pseudoHeaderLen-1] = ph.NextHeader |
| 161 | return buf |
| 162 | } |
| 163 | |
| 164 | func NewICMPTTLExceedPacket(originalIP *IP, originalPacket RawPacket, routerIP netip.Addr) *ICMP { |
| 165 | var ( |
no outgoing calls