+
+ p+=l2info->header_len;
+ l2info->length -= l2info->header_len;
+ l2info->caplen -= l2info->header_len;
+
+ /* search through the cookie table and copy values matching for our PIC type */
+ while (lp->s != NULL) {
+ if (lp->pictype == l2info->pictype) {
+
+ l2info->cookie_len = lp->cookie_len;
+ l2info->header_len += lp->cookie_len;
+
+ if(p[0] == LS_COOKIE_ID) {
+ l2info->cookie_type = LS_COOKIE;
+ l2info->cookie_len += 2;
+ l2info->header_len += 2;
+ l2info->bundle = l2info->cookie[1];
+ } else l2info->bundle = l2info->cookie[0];
+
+ if (eflag)
+ printf("%s-PIC, cookie-len %u",
+ lp->s,
+ l2info->cookie_len);
+
+ if (eflag && l2info->cookie_len > 0) {
+ printf(", cookie 0x");
+ for (idx = 0; idx < l2info->cookie_len; idx++) {
+ l2info->cookie[idx] = p[idx]; /* copy cookie data */
+ if (eflag) printf("%02x",p[idx]);
+ }
+ }
+
+ if (eflag) printf(": "); /* print demarc b/w L2/L3*/
+
+
+ l2info->proto = EXTRACT_16BITS(p+l2info->cookie_len);
+ break;
+ }
+ ++lp;
+ }
+ p+=l2info->cookie_len;
+
+ /* DLT_ specific parsing */
+ switch(l2info->pictype) {
+ case JUNIPER_MLPPP:
+ if (l2info->cookie_type == LS_COOKIE) {
+ l2info->bundle = l2info->cookie[1];
+ } else {
+ l2info->bundle = l2info->cookie[0];
+ }
+ break;
+ case JUNIPER_MLFR: /* fall through */
+ case JUNIPER_MFR:
+ if (l2info->cookie_type == LS_COOKIE) {
+ l2info->bundle = l2info->cookie[1];
+ } else {
+ l2info->bundle = l2info->cookie[0];
+ }
+ l2info->proto = EXTRACT_16BITS(p);
+ l2info->header_len += 2;
+ l2info->length -= 2;
+ l2info->caplen -= 2;
+ break;
+ case JUNIPER_ATM2:
+ case JUNIPER_ATM1:
+ default:
+
+ break;
+ }
+
+ if (eflag > 1)
+ printf("hlen %u, proto 0x%04x, ",l2info->header_len,l2info->proto);
+