• Home
  • Raw
  • Download

Lines Matching refs:l2info

458         struct juniper_l2info_t l2info;  in juniper_ggsn_print()  local
469 l2info.pictype = DLT_JUNIPER_GGSN; in juniper_ggsn_print()
470 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_ggsn_print()
471 return l2info.header_len; in juniper_ggsn_print()
473 p+=l2info.header_len; in juniper_ggsn_print()
474 gh = (struct juniper_ggsn_header *)&l2info.cookie; in juniper_ggsn_print()
485 ip_print(gndo, p, l2info.length); in juniper_ggsn_print()
489 ip6_print(gndo, p, l2info.length); in juniper_ggsn_print()
497 return l2info.header_len; in juniper_ggsn_print()
505 struct juniper_l2info_t l2info; in juniper_es_print() local
517 l2info.pictype = DLT_JUNIPER_ES; in juniper_es_print()
518 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_es_print()
519 return l2info.header_len; in juniper_es_print()
521 p+=l2info.header_len; in juniper_es_print()
538 l2info.length); in juniper_es_print()
539 return l2info.header_len; in juniper_es_print()
542 l2info.length-=rewrite_len; in juniper_es_print()
555 l2info.length); in juniper_es_print()
562 l2info.length); in juniper_es_print()
566 ip_print(gndo, p, l2info.length); in juniper_es_print()
567 return l2info.header_len; in juniper_es_print()
575 struct juniper_l2info_t l2info; in juniper_monitor_print() local
584 l2info.pictype = DLT_JUNIPER_MONITOR; in juniper_monitor_print()
585 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_monitor_print()
586 return l2info.header_len; in juniper_monitor_print()
588 p+=l2info.header_len; in juniper_monitor_print()
598 ip_heuristic_guess(p, l2info.length); in juniper_monitor_print()
600 return l2info.header_len; in juniper_monitor_print()
608 struct juniper_l2info_t l2info; in juniper_services_print() local
617 l2info.pictype = DLT_JUNIPER_SERVICES; in juniper_services_print()
618 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_services_print()
619 return l2info.header_len; in juniper_services_print()
621 p+=l2info.header_len; in juniper_services_print()
632 ip_heuristic_guess(p, l2info.length); in juniper_services_print()
634 return l2info.header_len; in juniper_services_print()
642 struct juniper_l2info_t l2info; in juniper_pppoe_print() local
644 l2info.pictype = DLT_JUNIPER_PPPOE; in juniper_pppoe_print()
645 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_pppoe_print()
646 return l2info.header_len; in juniper_pppoe_print()
648 p+=l2info.header_len; in juniper_pppoe_print()
650 ether_print(gndo, p, l2info.length, l2info.caplen, NULL, NULL); in juniper_pppoe_print()
651 return l2info.header_len; in juniper_pppoe_print()
659 struct juniper_l2info_t l2info; in juniper_ether_print() local
661 l2info.pictype = DLT_JUNIPER_ETHER; in juniper_ether_print()
662 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_ether_print()
663 return l2info.header_len; in juniper_ether_print()
665 p+=l2info.header_len; in juniper_ether_print()
667 ether_print(gndo, p, l2info.length, l2info.caplen, NULL, NULL); in juniper_ether_print()
668 return l2info.header_len; in juniper_ether_print()
676 struct juniper_l2info_t l2info; in juniper_ppp_print() local
678 l2info.pictype = DLT_JUNIPER_PPP; in juniper_ppp_print()
679 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_ppp_print()
680 return l2info.header_len; in juniper_ppp_print()
682 p+=l2info.header_len; in juniper_ppp_print()
684 ppp_print(p, l2info.length); in juniper_ppp_print()
685 return l2info.header_len; in juniper_ppp_print()
693 struct juniper_l2info_t l2info; in juniper_frelay_print() local
695 l2info.pictype = DLT_JUNIPER_FRELAY; in juniper_frelay_print()
696 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_frelay_print()
697 return l2info.header_len; in juniper_frelay_print()
699 p+=l2info.header_len; in juniper_frelay_print()
701 fr_print(p, l2info.length); in juniper_frelay_print()
702 return l2info.header_len; in juniper_frelay_print()
710 struct juniper_l2info_t l2info; in juniper_chdlc_print() local
712 l2info.pictype = DLT_JUNIPER_CHDLC; in juniper_chdlc_print()
713 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_chdlc_print()
714 return l2info.header_len; in juniper_chdlc_print()
716 p+=l2info.header_len; in juniper_chdlc_print()
718 chdlc_print(p, l2info.length); in juniper_chdlc_print()
719 return l2info.header_len; in juniper_chdlc_print()
727 struct juniper_l2info_t l2info; in juniper_pppoe_atm_print() local
730 l2info.pictype = DLT_JUNIPER_PPPOE_ATM; in juniper_pppoe_atm_print()
731 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_pppoe_atm_print()
732 return l2info.header_len; in juniper_pppoe_atm_print()
734 p+=l2info.header_len; in juniper_pppoe_atm_print()
741 l2info.length-ETHERTYPE_LEN, in juniper_pppoe_atm_print()
742 l2info.caplen-ETHERTYPE_LEN) == 0) in juniper_pppoe_atm_print()
746 return l2info.header_len; in juniper_pppoe_atm_print()
754 struct juniper_l2info_t l2info; in juniper_mlppp_print() local
756 l2info.pictype = DLT_JUNIPER_MLPPP; in juniper_mlppp_print()
757 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_mlppp_print()
758 return l2info.header_len; in juniper_mlppp_print()
763 EXTRACT_16BITS(&l2info.cookie) != PPP_OSI && in juniper_mlppp_print()
764 EXTRACT_16BITS(&l2info.cookie) != (PPP_ADDRESS << 8 | PPP_CONTROL)) in juniper_mlppp_print()
765 printf("Bundle-ID %u: ",l2info.bundle); in juniper_mlppp_print()
767 p+=l2info.header_len; in juniper_mlppp_print()
770 switch(l2info.proto) { in juniper_mlppp_print()
775 if (l2info.cookie[4] == (JUNIPER_LSQ_COOKIE_RE|JUNIPER_LSQ_COOKIE_DIR)) in juniper_mlppp_print()
776 ppp_print(p, l2info.length); in juniper_mlppp_print()
778 ip_print(gndo, p, l2info.length); in juniper_mlppp_print()
779 return l2info.header_len; in juniper_mlppp_print()
782 ip6_print(gndo, p,l2info.length); in juniper_mlppp_print()
783 return l2info.header_len; in juniper_mlppp_print()
786 mpls_print(p,l2info.length); in juniper_mlppp_print()
787 return l2info.header_len; in juniper_mlppp_print()
789 isoclns_print(p,l2info.length,l2info.caplen); in juniper_mlppp_print()
790 return l2info.header_len; in juniper_mlppp_print()
796 switch (EXTRACT_16BITS(&l2info.cookie)) { in juniper_mlppp_print()
798 ppp_print(p-2,l2info.length+2); in juniper_mlppp_print()
802 ppp_print(p,l2info.length); in juniper_mlppp_print()
806 return l2info.header_len; in juniper_mlppp_print()
815 struct juniper_l2info_t l2info; in juniper_mfr_print() local
817 l2info.pictype = DLT_JUNIPER_MFR; in juniper_mfr_print()
818 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_mfr_print()
819 return l2info.header_len; in juniper_mfr_print()
821 p+=l2info.header_len; in juniper_mfr_print()
824 if (l2info.cookie_len == 0) { in juniper_mfr_print()
825 mfr_print(p,l2info.length); in juniper_mfr_print()
826 return l2info.header_len; in juniper_mfr_print()
830 if (l2info.cookie_len == AS_PIC_COOKIE_LEN) { in juniper_mfr_print()
831 switch(l2info.proto) { in juniper_mfr_print()
833 ip_print(gndo, p, l2info.length); in juniper_mfr_print()
834 return l2info.header_len; in juniper_mfr_print()
837 ip6_print(gndo, p,l2info.length); in juniper_mfr_print()
838 return l2info.header_len; in juniper_mfr_print()
841 mpls_print(p,l2info.length); in juniper_mfr_print()
842 return l2info.header_len; in juniper_mfr_print()
844 isoclns_print(p,l2info.length,l2info.caplen); in juniper_mfr_print()
845 return l2info.header_len; in juniper_mfr_print()
849 return l2info.header_len; in juniper_mfr_print()
853 if (eflag && EXTRACT_32BITS(l2info.cookie) != 1) printf("Bundle-ID %u, ",l2info.bundle); in juniper_mfr_print()
854 switch (l2info.proto) { in juniper_mfr_print()
856 isoclns_print(p+1, l2info.length-1, l2info.caplen-1); in juniper_mfr_print()
862 isoclns_print(p-1, l2info.length+1, l2info.caplen+1); in juniper_mfr_print()
865 printf("unknown protocol 0x%04x, length %u",l2info.proto, l2info.length); in juniper_mfr_print()
868 return l2info.header_len; in juniper_mfr_print()
876 struct juniper_l2info_t l2info; in juniper_mlfr_print() local
878 l2info.pictype = DLT_JUNIPER_MLFR; in juniper_mlfr_print()
879 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_mlfr_print()
880 return l2info.header_len; in juniper_mlfr_print()
882 p+=l2info.header_len; in juniper_mlfr_print()
885 if (eflag && EXTRACT_32BITS(l2info.cookie) != 1) printf("Bundle-ID %u, ",l2info.bundle); in juniper_mlfr_print()
886 switch (l2info.proto) { in juniper_mlfr_print()
889 isoclns_print(p, l2info.length, l2info.caplen); in juniper_mlfr_print()
895 isoclns_print(p-1, l2info.length+1, l2info.caplen+1); in juniper_mlfr_print()
898 printf("unknown protocol 0x%04x, length %u",l2info.proto, l2info.length); in juniper_mlfr_print()
901 return l2info.header_len; in juniper_mlfr_print()
919 struct juniper_l2info_t l2info; in juniper_atm1_print() local
921 l2info.pictype = DLT_JUNIPER_ATM1; in juniper_atm1_print()
922 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_atm1_print()
923 return l2info.header_len; in juniper_atm1_print()
925 p+=l2info.header_len; in juniper_atm1_print()
927 if (l2info.cookie[0] == 0x80) { /* OAM cell ? */ in juniper_atm1_print()
928 oam_print(p,l2info.length,ATM_OAM_NOHEC); in juniper_atm1_print()
929 return l2info.header_len; in juniper_atm1_print()
935 if (llc_print(p, l2info.length, l2info.caplen, NULL, NULL, in juniper_atm1_print()
937 return l2info.header_len; in juniper_atm1_print()
941 isoclns_print(p + 1, l2info.length - 1, l2info.caplen - 1); in juniper_atm1_print()
943 return l2info.header_len; in juniper_atm1_print()
946 if(ip_heuristic_guess(p, l2info.length) != 0) /* last try - vcmux encaps ? */ in juniper_atm1_print()
947 return l2info.header_len; in juniper_atm1_print()
949 return l2info.header_len; in juniper_atm1_print()
967 struct juniper_l2info_t l2info; in juniper_atm2_print() local
969 l2info.pictype = DLT_JUNIPER_ATM2; in juniper_atm2_print()
970 if(juniper_parse_header(p, h, &l2info) == 0) in juniper_atm2_print()
971 return l2info.header_len; in juniper_atm2_print()
973 p+=l2info.header_len; in juniper_atm2_print()
975 if (l2info.cookie[7] & ATM2_PKT_TYPE_MASK) { /* OAM cell ? */ in juniper_atm2_print()
976 oam_print(p,l2info.length,ATM_OAM_NOHEC); in juniper_atm2_print()
977 return l2info.header_len; in juniper_atm2_print()
983 if (llc_print(p, l2info.length, l2info.caplen, NULL, NULL, in juniper_atm2_print()
985 return l2info.header_len; in juniper_atm2_print()
988 if (l2info.direction != JUNIPER_BPF_PKT_IN && /* ether-over-1483 encaps ? */ in juniper_atm2_print()
989 (EXTRACT_32BITS(l2info.cookie) & ATM2_GAP_COUNT_MASK)) { in juniper_atm2_print()
990 ether_print(gndo, p, l2info.length, l2info.caplen, NULL, NULL); in juniper_atm2_print()
991 return l2info.header_len; in juniper_atm2_print()
995 isoclns_print(p + 1, l2info.length - 1, l2info.caplen - 1); in juniper_atm2_print()
997 return l2info.header_len; in juniper_atm2_print()
1000 if(juniper_ppp_heuristic_guess(p, l2info.length) != 0) /* PPPoA vcmux encaps ? */ in juniper_atm2_print()
1001 return l2info.header_len; in juniper_atm2_print()
1003 if(ip_heuristic_guess(p, l2info.length) != 0) /* last try - vcmux encaps ? */ in juniper_atm2_print()
1004 return l2info.header_len; in juniper_atm2_print()
1006 return l2info.header_len; in juniper_atm2_print()
1134 juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct juniper_l2info_t *l2info in juniper_parse_header() argument
1144 l2info->header_len = 0; in juniper_parse_header()
1145 l2info->cookie_len = 0; in juniper_parse_header()
1146 l2info->proto = 0; in juniper_parse_header()
1149 l2info->length = h->len; in juniper_parse_header()
1150 l2info->caplen = h->caplen; in juniper_parse_header()
1152 l2info->flags = p[3]; in juniper_parse_header()
1153 l2info->direction = p[3]&JUNIPER_BPF_PKT_IN; in juniper_parse_header()
1161 printf("%3s ",tok2str(juniper_direction_values,"---",l2info->direction)); in juniper_parse_header()
1168 bittok2str(jnx_flag_values, "none", l2info->flags)); in juniper_parse_header()
1171 if ((l2info->flags & JUNIPER_BPF_EXT ) == JUNIPER_BPF_EXT ) { in juniper_parse_header()
1248 if ((l2info->flags & JUNIPER_BPF_NO_L2 ) == JUNIPER_BPF_NO_L2 ) { in juniper_parse_header()
1257 if(ip_heuristic_guess(p+jnx_header_len+4,l2info->length-(jnx_header_len+4)) == 0) in juniper_parse_header()
1260 l2info->header_len=jnx_header_len+4; in juniper_parse_header()
1264 l2info->header_len = jnx_header_len; in juniper_parse_header()
1265 p+=l2info->header_len; in juniper_parse_header()
1266 l2info->length -= l2info->header_len; in juniper_parse_header()
1267 l2info->caplen -= l2info->header_len; in juniper_parse_header()
1271 if (lp->pictype == l2info->pictype) { in juniper_parse_header()
1273 l2info->cookie_len += lp->cookie_len; in juniper_parse_header()
1277 l2info->cookie_type = LS_COOKIE_ID; in juniper_parse_header()
1278 l2info->cookie_len += 2; in juniper_parse_header()
1281 l2info->cookie_type = AS_COOKIE_ID; in juniper_parse_header()
1282 l2info->cookie_len = 8; in juniper_parse_header()
1286 l2info->bundle = l2info->cookie[0]; in juniper_parse_header()
1293 if (l2info->pictype == DLT_JUNIPER_MFR && in juniper_parse_header()
1295 l2info->cookie_len = 0; in juniper_parse_header()
1299 l2info->header_len += l2info->cookie_len; in juniper_parse_header()
1300 l2info->length -= l2info->cookie_len; in juniper_parse_header()
1301 l2info->caplen -= l2info->cookie_len; in juniper_parse_header()
1306 l2info->cookie_len); in juniper_parse_header()
1308 if (l2info->cookie_len > 0) { in juniper_parse_header()
1309 TCHECK2(p[0],l2info->cookie_len); in juniper_parse_header()
1312 for (idx = 0; idx < l2info->cookie_len; idx++) { in juniper_parse_header()
1313 l2info->cookie[idx] = p[idx]; /* copy cookie data */ in juniper_parse_header()
1321 l2info->proto = EXTRACT_16BITS(p+l2info->cookie_len); in juniper_parse_header()
1326 p+=l2info->cookie_len; in juniper_parse_header()
1329 switch(l2info->pictype) { in juniper_parse_header()
1332 switch (l2info->cookie_type) { in juniper_parse_header()
1334 l2info->bundle = l2info->cookie[1]; in juniper_parse_header()
1337 l2info->bundle = (EXTRACT_16BITS(&l2info->cookie[6])>>3)&0xfff; in juniper_parse_header()
1338 l2info->proto = (l2info->cookie[5])&JUNIPER_LSQ_L3_PROTO_MASK; in juniper_parse_header()
1341 l2info->bundle = l2info->cookie[0]; in juniper_parse_header()
1348 switch (l2info->cookie_type) { in juniper_parse_header()
1350 l2info->bundle = l2info->cookie[1]; in juniper_parse_header()
1351 l2info->proto = EXTRACT_16BITS(p); in juniper_parse_header()
1352 l2info->header_len += 2; in juniper_parse_header()
1353 l2info->length -= 2; in juniper_parse_header()
1354 l2info->caplen -= 2; in juniper_parse_header()
1357 l2info->bundle = (EXTRACT_16BITS(&l2info->cookie[6])>>3)&0xfff; in juniper_parse_header()
1358 l2info->proto = (l2info->cookie[5])&JUNIPER_LSQ_L3_PROTO_MASK; in juniper_parse_header()
1361 l2info->bundle = l2info->cookie[0]; in juniper_parse_header()
1362 l2info->header_len += 2; in juniper_parse_header()
1363 l2info->length -= 2; in juniper_parse_header()
1364 l2info->caplen -= 2; in juniper_parse_header()
1371 switch (l2info->cookie_type) { in juniper_parse_header()
1373 l2info->bundle = l2info->cookie[1]; in juniper_parse_header()
1374 l2info->proto = EXTRACT_16BITS(p); in juniper_parse_header()
1375 l2info->header_len += 2; in juniper_parse_header()
1376 l2info->length -= 2; in juniper_parse_header()
1377 l2info->caplen -= 2; in juniper_parse_header()
1380 l2info->bundle = (EXTRACT_16BITS(&l2info->cookie[6])>>3)&0xfff; in juniper_parse_header()
1381 l2info->proto = (l2info->cookie[5])&JUNIPER_LSQ_L3_PROTO_MASK; in juniper_parse_header()
1384 l2info->bundle = l2info->cookie[0]; in juniper_parse_header()
1393 if (l2info->cookie[7] & ATM2_PKT_TYPE_MASK) { in juniper_parse_header()
1400 l2info->header_len += 4; in juniper_parse_header()
1437 printf("Unknown Juniper DLT_ type %u: ", l2info->pictype); in juniper_parse_header()
1442 printf("hlen %u, proto 0x%04x, ",l2info->header_len,l2info->proto); in juniper_parse_header()