MCPcopy Create free account
hub / github.com/F-Stack/f-stack / kdebug_sadb_identity

Function kdebug_sadb_identity

freebsd/netipsec/key_debug.c:318–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318static void
319kdebug_sadb_identity(struct sadb_ext *ext)
320{
321 struct sadb_ident *id = (struct sadb_ident *)ext;
322 int len;
323
324 /* sanity check */
325 if (ext == NULL)
326 panic("%s: NULL pointer was passed.\n", __func__);
327
328 len = PFKEY_UNUNIT64(id->sadb_ident_len) - sizeof(*id);
329 printf("sadb_ident_%s{",
330 id->sadb_ident_exttype == SADB_EXT_IDENTITY_SRC ? "src" : "dst");
331 switch (id->sadb_ident_type) {
332 default:
333 printf(" type=%d id=%lu",
334 id->sadb_ident_type, (u_long)id->sadb_ident_id);
335 if (len) {
336#ifdef _KERNEL
337 ipsec_hexdump((caddr_t)(id + 1), len); /*XXX cast ?*/
338#else
339 char *p, *ep;
340 printf("\n str=\"");
341 p = (char *)(id + 1);
342 ep = p + len;
343 for (/*nothing*/; *p && p < ep; p++) {
344 if (isprint(*p))
345 printf("%c", *p & 0xff);
346 else
347 printf("\\%03o", *p & 0xff);
348 }
349#endif
350 printf("\"");
351 }
352 break;
353 }
354
355 printf(" }\n");
356
357 return;
358}
359
360static void
361kdebug_sadb_supported(struct sadb_ext *ext)

Callers 1

kdebug_sadbFunction · 0.85

Calls 4

ipsec_hexdumpFunction · 0.85
isprintFunction · 0.85
panicFunction · 0.50
printfFunction · 0.50

Tested by

no test coverage detected