Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netipsec/key_debug.c
| Show First 20 Lines • Show All 564 Lines • ▼ Show 20 Lines | kdebug_secasv(struct secasvar *sav) | ||||
| printf(" spi=%u flags=%u\n", | printf(" spi=%u flags=%u\n", | ||||
| (u_int32_t)ntohl(sav->spi), sav->flags); | (u_int32_t)ntohl(sav->spi), sav->flags); | ||||
| if (sav->key_auth != NULL) | if (sav->key_auth != NULL) | ||||
| kdebug_sadb_key((struct sadb_ext *)sav->key_auth); | kdebug_sadb_key((struct sadb_ext *)sav->key_auth); | ||||
| if (sav->key_enc != NULL) | if (sav->key_enc != NULL) | ||||
| kdebug_sadb_key((struct sadb_ext *)sav->key_enc); | kdebug_sadb_key((struct sadb_ext *)sav->key_enc); | ||||
| if (sav->replay != NULL) | if (sav->replay != NULL) { | ||||
| SECASVAR_LOCK(sav); | |||||
| kdebug_secreplay(sav->replay); | kdebug_secreplay(sav->replay); | ||||
| SECASVAR_UNLOCK(sav); | |||||
| } | |||||
| if (sav->lft_c != NULL) | if (sav->lft_c != NULL) | ||||
| kdebug_sec_lifetime(sav->lft_c); | kdebug_sec_lifetime(sav->lft_c); | ||||
| if (sav->lft_h != NULL) | if (sav->lft_h != NULL) | ||||
| kdebug_sec_lifetime(sav->lft_h); | kdebug_sec_lifetime(sav->lft_h); | ||||
| if (sav->lft_s != NULL) | if (sav->lft_s != NULL) | ||||
| kdebug_sec_lifetime(sav->lft_s); | kdebug_sec_lifetime(sav->lft_s); | ||||
| #ifdef notyet | #ifdef notyet | ||||
| /* XXX: misc[123] ? */ | /* XXX: misc[123] ? */ | ||||
| #endif | #endif | ||||
| return; | return; | ||||
| } | } | ||||
| static void | static void | ||||
| kdebug_secreplay(struct secreplay *rpl) | kdebug_secreplay(struct secreplay *rpl) | ||||
| { | { | ||||
| int len, l; | int len, l; | ||||
| /* sanity check */ | /* sanity check */ | ||||
| if (rpl == NULL) | if (rpl == NULL) | ||||
| panic("%s: NULL pointer was passed.\n", __func__); | panic("%s: NULL pointer was passed.\n", __func__); | ||||
| printf(" secreplay{ count=%u wsize=%u seq=%u lastseq=%u", | printf(" secreplay{ count=%u bitmap_size=%u wsize=%u seq=%u lastseq=%u", | ||||
| rpl->count, rpl->wsize, rpl->seq, rpl->lastseq); | rpl->count, rpl->bitmap_size, rpl->wsize, rpl->seq, rpl->lastseq); | ||||
| if (rpl->bitmap == NULL) { | if (rpl->bitmap == NULL) { | ||||
| printf(" }\n"); | printf(" }\n"); | ||||
| return; | return; | ||||
| } | } | ||||
| printf("\n bitmap { "); | printf("\n bitmap { "); | ||||
| for (len = 0; len < rpl->wsize; len++) { | for (len = 0; len < rpl->bitmap_size*4; len++) { | ||||
| for (l = 7; l >= 0; l--) | for (l = 7; l >= 0; l--) | ||||
| printf("%u", (((rpl->bitmap)[len] >> l) & 1) ? 1 : 0); | printf("%u", (((rpl->bitmap)[len] >> l) & 1) ? 1 : 0); | ||||
| } | } | ||||
| printf(" }\n"); | printf(" }\n"); | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines | |||||