Changeset View
Changeset View
Standalone View
Standalone View
contrib/tcpdump/print-pfsync.c
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
static void pfsync_print(netdissect_options *, struct pfsync_header *, | static void pfsync_print(netdissect_options *, struct pfsync_header *, | ||||
const u_char *, u_int); | const u_char *, u_int); | ||||
static void print_src_dst(netdissect_options *, | static void print_src_dst(netdissect_options *, | ||||
const struct pfsync_state_peer *, | const struct pfsync_state_peer *, | ||||
const struct pfsync_state_peer *, uint8_t); | const struct pfsync_state_peer *, uint8_t); | ||||
static void print_state(netdissect_options *, struct pfsync_state *); | static void print_state(netdissect_options *, struct pfsync_state *); | ||||
#ifdef notyet | u_int | ||||
void | pfsync_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, | ||||
pfsync_if_print(u_char *user, const struct pcap_pkthdr *h, | |||||
register const u_char *p) | register const u_char *p) | ||||
{ | { | ||||
u_int caplen = h->caplen; | u_int caplen = h->caplen; | ||||
ts_print(&h->ts); | ts_print(ndo, &h->ts); | ||||
if (caplen < PFSYNC_HDRLEN) { | if (caplen < PFSYNC_HDRLEN) { | ||||
ND_PRINT((ndo, "[|pfsync]")); | ND_PRINT((ndo, "[|pfsync]")); | ||||
goto out; | goto out; | ||||
} | } | ||||
pfsync_print((struct pfsync_header *)p, | pfsync_print(ndo, (struct pfsync_header *)p, | ||||
p + sizeof(struct pfsync_header), | p + sizeof(struct pfsync_header), | ||||
caplen - sizeof(struct pfsync_header)); | caplen - sizeof(struct pfsync_header)); | ||||
out: | out: | ||||
if (xflag) { | if (ndo->ndo_xflag) { | ||||
default_print((const u_char *)p, caplen); | hex_print(ndo, "\n\t", p, caplen); | ||||
} | } | ||||
safeputchar(ndo, '\n'); | safeputchar(ndo, '\n'); | ||||
return (caplen); | |||||
} | } | ||||
#endif /* notyet */ | |||||
void | void | ||||
pfsync_ip_print(netdissect_options *ndo , const u_char *bp, u_int len) | pfsync_ip_print(netdissect_options *ndo , const u_char *bp, u_int len) | ||||
{ | { | ||||
struct pfsync_header *hdr = (struct pfsync_header *)bp; | struct pfsync_header *hdr = (struct pfsync_header *)bp; | ||||
if (len < PFSYNC_HDRLEN) | if (len < PFSYNC_HDRLEN) | ||||
ND_PRINT((ndo, "[|pfsync]")); | ND_PRINT((ndo, "[|pfsync]")); | ||||
▲ Show 20 Lines • Show All 368 Lines • Show Last 20 Lines |