123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
- #include <netdissect-stdinc.h>
- #include "netdissect.h"
- #include "slcompress.h"
- #include "ppp.h"
- int
- vjc_print(netdissect_options *ndo, register const char *bp, u_short proto _U_)
- {
- int i;
- switch (bp[0] & 0xf0) {
- case TYPE_IP:
- if (ndo->ndo_eflag)
- ND_PRINT((ndo, "(vjc type=IP) "));
- return PPP_IP;
- case TYPE_UNCOMPRESSED_TCP:
- if (ndo->ndo_eflag)
- ND_PRINT((ndo, "(vjc type=raw TCP) "));
- return PPP_IP;
- case TYPE_COMPRESSED_TCP:
- if (ndo->ndo_eflag)
- ND_PRINT((ndo, "(vjc type=compressed TCP) "));
- for (i = 0; i < 8; i++) {
- if (bp[1] & (0x80 >> i))
- ND_PRINT((ndo, "%c", "?CI?SAWU"[i]));
- }
- if (bp[1])
- ND_PRINT((ndo, " "));
- ND_PRINT((ndo, "C=0x%02x ", bp[2]));
- ND_PRINT((ndo, "sum=0x%04x ", *(const u_short *)&bp[3]));
- return -1;
- case TYPE_ERROR:
- if (ndo->ndo_eflag)
- ND_PRINT((ndo, "(vjc type=error) "));
- return -1;
- default:
- if (ndo->ndo_eflag)
- ND_PRINT((ndo, "(vjc type=0x%02x) ", bp[0] & 0xf0));
- return -1;
- }
- }
|