ClientCollectors/ARODataCollector/external/tcpdump-4.1.1/print-isakmp.c
static int ike_show_somedata(struct netdissect_options *ndo,
			     const u_char *cp, const u_char *ep)
{
	/* there is too much data, just show some of it */
	const u_char *end = ep - 20;
	int  elen = 20;
	int   len = ep - cp;
	if(len > 10) {
		len = 10;
	}
	
	/* really shouldn't happen because of above */
	if(end < cp + len) {
		end = cp+len;
		elen = ep - end;
	}
	
	ND_PRINT((ndo," data=("));
	if(!rawprint(ndo, (caddr_t)(cp), len)) goto trunc;
	ND_PRINT((ndo, "..."));
	if(elen) {
		if(!rawprint(ndo, (caddr_t)(end), elen)) goto trunc;
	}
	ND_PRINT((ndo,")"));
	return 1;

trunc:
	return 0;
}
/*
 * returns false if we run out of data buffer
 */
returns false if we run out of data buffer
returns false if we run out of data buffer
static int ike_show_somedata(struct netdissect_options *ndo,
			     const u_char *cp, const u_char *ep)
{
	const u_char *end = ep - 20;
	int  elen = 20;
	int   len = ep - cp;
	if(len > 10) {
		len = 10;
	}
	if(end < cp + len) {
		end = cp+len;
		elen = ep - end;
	}
	ND_PRINT((ndo," data=("));
	if(!rawprint(ndo, (caddr_t)(cp), len)) goto trunc;
	ND_PRINT((ndo, "..."));
	if(elen) {
		if(!rawprint(ndo, (caddr_t)(end), elen)) goto trunc;
	}
	ND_PRINT((ndo,")"));
	return 1;
trunc:
	return 0;
}
static int ike_show_somedata ( struct netdissect_options * ndo , const u_char * cp , const u_char * ep ) { const u_char * end = ep - 20 ; int elen = 20 ; int len = ep - cp ; if ( len > 10 ) { len = 10 ; } if ( end < cp + len ) { end = cp + len ; elen = ep - end ; } ND_PRINT ( ( ndo , " " ) ) ; if ( ! rawprint ( ndo , ( caddr_t ) ( cp ) , len ) ) goto trunc ; ND_PRINT ( ( ndo , " " ) ) ; if ( elen ) { if ( ! rawprint ( ndo , ( caddr_t ) ( end ) , elen ) ) goto trunc ; } ND_PRINT ( ( ndo , " " ) ) ; return 1 ; trunc : return 0 ; }
returns false if we run out of data buffer
returns false if we run out of data buffer
/* there is too much data, just show some of it */ /* really shouldn't happen because of above */