Lines Matching refs:ndo

97 int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo,  in esp_print_decrypt_buffer_by_ikev2()  argument
111 for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { in esp_print_decrypt_buffer_by_ikev2()
135 (*ndo->ndo_warning)(ndo, "espkey init failed"); in esp_print_decrypt_buffer_by_ikev2()
140 ndo->ndo_packetp = buf; in esp_print_decrypt_buffer_by_ikev2()
141 ndo->ndo_snapend = end; in esp_print_decrypt_buffer_by_ikev2()
148 static void esp_print_addsa(netdissect_options *ndo, in esp_print_addsa() argument
157 (*ndo->ndo_error)(ndo, "ran out of memory to allocate sa structure"); in esp_print_addsa()
162 ndo->ndo_sa_default = nsa; in esp_print_addsa()
164 nsa->next = ndo->ndo_sa_list_head; in esp_print_addsa()
165 ndo->ndo_sa_list_head = nsa; in esp_print_addsa()
169 static u_int hexdigit(netdissect_options *ndo, char hex) in hexdigit() argument
178 (*ndo->ndo_error)(ndo, "invalid hex digit %c in espsecret\n", hex); in hexdigit()
183 static u_int hex2byte(netdissect_options *ndo, char *hexstring) in hex2byte() argument
187 byte = (hexdigit(ndo, hexstring[0]) << 4) + hexdigit(ndo, hexstring[1]); in hex2byte()
195 int espprint_decode_hex(netdissect_options *ndo, in espprint_decode_hex() argument
205 (*ndo->ndo_warning)(ndo, "secret is too big: %d\n", len); in espprint_decode_hex()
211 binbuf[i] = hex2byte(ndo, hex); in espprint_decode_hex()
225 espprint_decode_encalgo(netdissect_options *ndo, in espprint_decode_encalgo() argument
235 (*ndo->ndo_warning)(ndo, "failed to decode espsecret: %s\n", decode); in espprint_decode_encalgo()
255 (*ndo->ndo_warning)(ndo, "failed to find cipher algo %s\n", decode); in espprint_decode_encalgo()
271 sa->secretlen = espprint_decode_hex(ndo, sa->secret, sizeof(sa->secret), colon); in espprint_decode_encalgo()
294 espprint_decode_authalgo(netdissect_options *ndo, in espprint_decode_authalgo() argument
301 (*ndo->ndo_warning)(ndo, "failed to decode espsecret: %s\n", decode); in espprint_decode_authalgo()
313 static void esp_print_decode_ikeline(netdissect_options *ndo, char *line, in esp_print_decode_ikeline() argument
333 (*ndo->ndo_warning)(ndo, "print_esp: failed to find all fields for ikev2 at %s:%u", in esp_print_decode_ikeline()
347 (*ndo->ndo_warning)(ndo, "print_esp: line %s:%u improperly formatted.", in esp_print_decode_ikeline()
350 (*ndo->ndo_warning)(ndo, "init=%s icookie=%s(%u) rcookie=%s(%u)", in esp_print_decode_ikeline()
358 if(espprint_decode_hex(ndo, sa1.spii, sizeof(sa1.spii), icookie+2)!=8) in esp_print_decode_ikeline()
361 if(espprint_decode_hex(ndo, sa1.spir, sizeof(sa1.spir), rcookie+2)!=8) in esp_print_decode_ikeline()
364 if(!espprint_decode_encalgo(ndo, enckey, &sa1)) return; in esp_print_decode_ikeline()
366 if(!espprint_decode_authalgo(ndo, authkey, &sa1)) return; in esp_print_decode_ikeline()
368 esp_print_addsa(ndo, &sa1, FALSE); in esp_print_decode_ikeline()
377 static void esp_print_decode_onesecret(netdissect_options *ndo, char *line, in esp_print_decode_onesecret() argument
423 esp_print_decode_onesecret(ndo, fileline, filename, lineno); in esp_print_decode_onesecret()
431 esp_print_decode_ikeline(ndo, line, file, lineno); in esp_print_decode_onesecret()
448 (*ndo->ndo_warning)(ndo, "print_esp: failed to decode spi# %s\n", foo); in esp_print_decode_onesecret()
470 (*ndo->ndo_warning)(ndo, "print_esp: can not decode IP# %s\n", spikey); in esp_print_decode_onesecret()
480 if(!espprint_decode_encalgo(ndo, decode, &sa1)) { in esp_print_decode_onesecret()
485 esp_print_addsa(ndo, &sa1, sa_def); in esp_print_decode_onesecret()
489 static void esp_init(netdissect_options *ndo _U_) in esp_init()
497 void esp_print_decodesecret(netdissect_options *ndo) in esp_print_decodesecret() argument
504 esp_init(ndo); in esp_print_decodesecret()
508 p = ndo->ndo_espsecret; in esp_print_decodesecret()
517 esp_print_decode_onesecret(ndo, line, "cmdline", 0); in esp_print_decodesecret()
520 ndo->ndo_espsecret = NULL; in esp_print_decodesecret()
529 esp_print(netdissect_options *ndo, in esp_print() argument
576 ep = ndo->ndo_snapend; in esp_print()
582 (*ndo->ndo_printf)(ndo, "ESP(spi=0x%08x", EXTRACT_32BITS(&esp->esp_spi)); in esp_print()
583 (*ndo->ndo_printf)(ndo, ",seq=0x%x)", EXTRACT_32BITS(&esp->esp_seq)); in esp_print()
584 (*ndo->ndo_printf)(ndo, ", length %u", length); in esp_print()
590 if (ndo->ndo_sa_list_head == NULL) { in esp_print()
591 if (!ndo->ndo_espsecret) in esp_print()
594 esp_print_decodesecret(ndo); in esp_print()
597 if (ndo->ndo_sa_list_head == NULL) in esp_print()
612 for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { in esp_print()
630 for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { in esp_print()
648 sa = ndo->ndo_sa_default; in esp_print()
670 (*ndo->ndo_warning)(ndo, "espkey init failed"); in esp_print()
690 (ndo->ndo_printf)(ndo, ": "); in esp_print()