MCPcopy
hub / github.com/cilium/cilium / Message

Method Message

pkg/monitor/datapath_debug.go:282–423  ·  view source on GitHub ↗

Message returns the debug message in a human-readable format

(linkMonitor getters.LinkGetter)

Source from the content-addressed store, hash-verified

280
281// Message returns the debug message in a human-readable format
282func (n *DebugMsg) Message(linkMonitor getters.LinkGetter) string {
283 switch n.SubType {
284 case DbgGeneric:
285 return fmt.Sprintf("No message, arg1=%d (%#x) arg2=%d (%#x)", n.Arg1, n.Arg1, n.Arg2, n.Arg2)
286 case DbgLocalDelivery:
287 return fmt.Sprintf("Attempting local delivery for container id %d from seclabel %d", n.Arg1, n.Arg2)
288 case DbgEncap:
289 return fmt.Sprintf("Encapsulating to node %d (%#x) from seclabel %d", n.Arg1, n.Arg1, n.Arg2)
290 case DbgLxcFound:
291 var ifname string
292 if linkMonitor != nil {
293 ifname = linkMonitor.Name(n.Arg1)
294 }
295 return fmt.Sprintf("Local container found ifindex %s seclabel %d", ifname, byteorder.NetworkToHost16(uint16(n.Arg2)))
296 case DbgPolicyDenied:
297 return fmt.Sprintf("Policy evaluation would deny packet from %d to %d", n.Arg1, n.Arg2)
298 case DbgCtLookup:
299 return fmt.Sprintf("CT lookup: %s", ctInfo(n.Arg1, n.Arg2))
300 case DbgCtLookupRev:
301 return fmt.Sprintf("CT reverse lookup: %s", ctInfo(n.Arg1, n.Arg2))
302 case DbgCtLookup4:
303 return fmt.Sprintf("CT lookup address: %s", ip4Str(n.Arg1))
304 case DbgCtMatch:
305 return fmt.Sprintf("CT entry found lifetime=%d, %s", n.Arg1,
306 verdictInfo(n.Arg2))
307 case DbgCtCreated:
308 return fmt.Sprintf("CT created 1/2: %s %s",
309 ctInfo(n.Arg1, n.Arg2), verdictInfo(n.Arg3))
310 case DbgCtCreated2:
311 return fmt.Sprintf("CT created 2/2: %s revnat=%d", ip4Str(n.Arg1), byteorder.NetworkToHost16(uint16(n.Arg2)))
312 case DbgCtVerdict:
313 return fmt.Sprintf("CT verdict: %s, %s",
314 ctState(n.Arg1), verdictInfo(n.Arg2))
315 case DbgIcmp6Handle:
316 return fmt.Sprintf("Handling ICMPv6 type=%d", n.Arg1)
317 case DbgIcmp6Request:
318 return fmt.Sprintf("ICMPv6 echo request for router offset=%d", n.Arg1)
319 case DbgIcmp6Ns:
320 return fmt.Sprintf("ICMPv6 neighbour soliciation for address %x:%x", n.Arg1, n.Arg2)
321 case DbgIcmp6TimeExceeded:
322 return "Sending ICMPv6 time exceeded"
323 case DbgDecap:
324 return fmt.Sprintf("Tunnel decap: id=%d flowlabel=%x", n.Arg1, n.Arg2)
325 case DbgPortMap:
326 return fmt.Sprintf("Mapping port from=%d to=%d", n.Arg1, n.Arg2)
327 case DbgErrorRet:
328 return fmt.Sprintf("BPF function %d returned error %d", n.Arg1, n.Arg2)
329 case DbgToHost:
330 return fmt.Sprintf("Going to host, policy-skip=%d", n.Arg1)
331 case DbgToStack:
332 return fmt.Sprintf("Going to the stack, policy-skip=%d", n.Arg1)
333 case DbgPktHash:
334 return fmt.Sprintf("Packet hash=%d (%#x), selected_service=%d", n.Arg1, n.Arg1, n.Arg2)
335 case DbgRRBackendSlotSel:
336 return fmt.Sprintf("RR backend slot selection hash=%d (%#x), selected_service=%d", n.Arg1, n.Arg1, n.Arg2)
337 case DbgLb6LookupFrontend:
338 return fmt.Sprintf("Frontend service lookup, addr.p4=%x key.dport=%d", n.Arg1, byteorder.NetworkToHost16(uint16(n.Arg2)))
339 case DbgLb6LookupFrontendFail:

Callers 9

DumpMethod · 0.95
getJSONMethod · 0.95
newAgentEventsCommandFunction · 0.80
newFlowsCmdHelperFunction · 0.80
newDebugEventsCommandFunction · 0.80
DecodeMethod · 0.80
CopyMethod · 0.80
AllocMethod · 0.80
nodeStatusErrorFunction · 0.80

Calls 15

NetworkToHost16Function · 0.92
ctInfoFunction · 0.85
ip4StrFunction · 0.85
verdictInfoFunction · 0.85
ctStateFunction · 0.85
ctLookup4Info1Function · 0.85
ctLookup4Info2Function · 0.85
ctCreate4InfoFunction · 0.85
ctLookup6Info1Function · 0.85
ctCreate6InfoFunction · 0.85
l4CreateInfoFunction · 0.85
ip6StrFunction · 0.85

Tested by

no test coverage detected