| 316 | } |
| 317 | |
| 318 | static void |
| 319 | kdebug_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 | |
| 360 | static void |
| 361 | kdebug_sadb_supported(struct sadb_ext *ext) |
no test coverage detected