ClientCollectors/ARODataCollector/external/tcpdump-4.1.1/print-esp.c
static int
espprint_decode_authalgo(netdissect_options *ndo,
			 char *decode, struct sa_list *sa)
{
	char *colon;

	colon = strchr(decode, ':');
	if (colon == NULL) {
		(*ndo->ndo_warning)(ndo, "failed to decode espsecret: %s\n", decode);
		return 0;
	}
	*colon = '\0';
	
	if(strcasecmp(colon,"sha1") == 0 ||
	   strcasecmp(colon,"md5") == 0) {
		sa->authlen = 12;
	}
	return 1;
}
/*
 * for the moment, ignore the auth algorith, just hard code the authenticator
 * length. Need to research how openssl looks up HMAC stuff.
 */
for the moment, ignore the auth algorith, just hard code the authenticator
length. Need to research how openssl looks up HMAC stuff.
for the moment ignore the auth algorith just hard code the authenticator length . Need to research how openssl looks up HMAC stuff .
static int
espprint_decode_authalgo(netdissect_options *ndo,
			 char *decode, struct sa_list *sa)
{
	char *colon;
	colon = strchr(decode, ':');
	if (colon == NULL) {
		(*ndo->ndo_warning)(ndo, "failed to decode espsecret: %s\n", decode);
		return 0;
	}
	*colon = '\0';
	if(strcasecmp(colon,"sha1") == 0 ||
	   strcasecmp(colon,"md5") == 0) {
		sa->authlen = 12;
	}
	return 1;
}
static int espprint_decode_authalgo ( netdissect_options * ndo , char * decode , struct sa_list * sa ) { char * colon ; colon = strchr ( decode , ' ' ) ; if ( colon == NULL ) { ( * ndo -> ndo_warning ) ( ndo , " \n " , decode ) ; return 0 ; } * colon = ' \0 ' ; if ( strcasecmp ( colon , " " ) == 0 || strcasecmp ( colon , " " ) == 0 ) { sa -> authlen = 12 ; } return 1 ; }
for the moment, ignore the auth algorith, just hard code the authenticator
 length.
for the moment ignore the auth algorith just hard code the authenticator length .