MCPcopy
hub / github.com/cloudflare/cloudflared / Marshal

Method Marshal

packet/packet.go:150–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148}
149
150func (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
164func NewICMPTTLExceedPacket(originalIP *IP, originalPacket RawPacket, routerIP netip.Addr) *ICMP {
165 var (

Callers 15

EncodeLayersMethod · 0.95
EncodeOriginCertMethod · 0.45
mustInitRespMetaHeaderFunction · 0.45
EncodeMethod · 0.45
CountFieldsFunction · 0.45
MarshalJSONMethod · 0.45
TestMarshalJSONFunction · 0.45
MarshalJSONMethod · 0.45
MarshalJSONMethod · 0.45
MarshalJSONMethod · 0.45
MarshalJSONMethod · 0.45

Calls

no outgoing calls

Tested by 15

CountFieldsFunction · 0.36
TestMarshalJSONFunction · 0.36
signTokenFunction · 0.36
TestCertGenSuccessFunction · 0.36
respondWithJSONFunction · 0.36
lookupRecordMethod · 0.36
lookupRecordMethod · 0.36
respondWithJSONFunction · 0.36
Test_TunnelTokenFunction · 0.36
TestSerializeLocalConfigFunction · 0.36