contrib/tcpdump/print-esp.c
/*
 * returns size of binary, 0 on failure.
 */
returns size of binary, 0 on failure.
returns size of binary 0 on failure .
static
int espprint_decode_hex(netdissect_options *ndo,
			u_char *binbuf, unsigned int binbuf_len,
			char *hex)
{
	unsigned int len;
	int i;
	len = strlen(hex) / 2;
	if (len > binbuf_len) {
		(*ndo->ndo_warning)(ndo, "secret is too big: %d\n", len);
		return 0;
	}
	i = 0;
	while (hex[0] != '\0' && hex[1]!='\0') {
		binbuf[i] = hex2byte(ndo, hex);
		hex += 2;
		i++;
	}
	return i;
}
static int espprint_decode_hex ( netdissect_options * ndo , u_char * binbuf , unsigned int binbuf_len , char * hex ) { unsigned int len ; int i ; len = strlen ( hex ) / 2 ; if ( len > binbuf_len ) { ( * ndo -> ndo_warning ) ( ndo , " \n " , len ) ; return 0 ; } i = 0 ; while ( hex [ 0 ] != ' \0 ' && hex [ 1 ] != ' \0 ' ) { binbuf [ i ] = hex2byte ( ndo , hex ) ; hex += 2 ; i ++ ; } return i ; }
returns size of binary, 0 on failure.
returns size of binary 0 on failure .