static int send_accounts_to_bic( ACCOUNTS *Account_list) { OAM_DataScaffold *datapod; IsmData *ismdata; char estring[256]; char token[64]; ACCOUNTS *acct; int numaccts = 0; int rc = 0; /* In order to make the loops more readable, I'll make two passes * over the account list. The first pass, will look at all the * accounts done and report them to BIC. The second pass, will * remove all the accounts done from the list. */ #define HAVE_ACCTS() (acct != NULL) acct = Account_list; numaccts = 0; oam_print( "ISM_MAX_ACCTS_IN_DATA_PACKET = %d\n", ISM_MAX_ACCTS_IN_DATA_PACKET); while( HAVE_ACCTS()) { /* while traversing through the internal account list */ datapod = create_OAM_DataScaffold( ISM_MSGTYPE_BLS_TO_BIC); OAM_DataScaffold_add_namepair( datapod, ISM_BXNAME_SUBTYPE , ISM_BXVAL_CMF_LIST, estring); OAM_DataScaffold_init_datasegment( datapod, "LIST", ISM_MAX_ACCTS_IN_DATA_PACKET, 1); TRACE(); while( HAVE_ACCTS()) { TRACE(); sprintf_ACCOUNTS_info( token, acct); if( OAM_DataScaffold_datasegment_has_room( datapod, token)) { TRACE(); ++numaccts; OAM_DataScaffold_add_datasegment_token( datapod, token, estring); acct = acct->next; } else break; } OAM_DataScaffold_term_datasegment( datapod, ISM_BXNAME_NUMLIST, estring); ismdata = OAM_DataScaffold_fetch_IsmData( datapod); rc = MA_SendData( ismdata, (char*) "Account List"); OAM_DataScaffold_destroy(datapod); } /* Second scan: purge accounts, not added -yet */ return SUCCESS; }
/* * Print an ATM PDU (such as an AAL5 PDU). */ void atm_print(netdissect_options *ndo, u_int vpi, u_int vci, u_int traftype, const u_char *p, u_int length, u_int caplen) { if (ndo->ndo_eflag) ND_PRINT((ndo, "VPI:%u VCI:%u ", vpi, vci)); if (vpi == 0) { switch (vci) { case VCI_PPC: sig_print(ndo, p, caplen); return; case VCI_BCC: ND_PRINT((ndo, "broadcast sig: ")); return; case VCI_OAMF4SC: /* fall through */ case VCI_OAMF4EC: oam_print(ndo, p, length, ATM_OAM_HEC); return; case VCI_METAC: ND_PRINT((ndo, "meta: ")); return; case VCI_ILMIC: ND_PRINT((ndo, "ilmi: ")); snmp_print(ndo, p, length); return; } } switch (traftype) { case ATM_LLC: default: /* * Assumes traffic is LLC if unknown. */ atm_llc_print(ndo, p, length, caplen); break; case ATM_LANE: lane_print(ndo, p, length, caplen); break; } }
u_int juniper_atm2_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { uint16_t extracted_ethertype; struct juniper_l2info_t l2info; l2info.pictype = DLT_JUNIPER_ATM2; if (juniper_parse_header(ndo, p, h, &l2info) == 0) return l2info.header_len; p+=l2info.header_len; if (l2info.cookie[7] & ATM2_PKT_TYPE_MASK) { /* OAM cell ? */ oam_print(ndo, p, l2info.length, ATM_OAM_NOHEC); return l2info.header_len; } if (EXTRACT_24BITS(p) == 0xfefe03 || /* NLPID encaps ? */ EXTRACT_24BITS(p) == 0xaaaa03) { /* SNAP encaps ? */ if (llc_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL, &extracted_ethertype) != 0) return l2info.header_len; } if (l2info.direction != JUNIPER_BPF_PKT_IN && /* ether-over-1483 encaps ? */ (EXTRACT_32BITS(l2info.cookie) & ATM2_GAP_COUNT_MASK)) { ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL); return l2info.header_len; } if (p[0] == 0x03) { /* Cisco style NLPID encaps ? */ isoclns_print(ndo, p + 1, l2info.length - 1, l2info.caplen - 1); /* FIXME check if frame was recognized */ return l2info.header_len; } if(juniper_ppp_heuristic_guess(ndo, p, l2info.length) != 0) /* PPPoA vcmux encaps ? */ return l2info.header_len; if (ip_heuristic_guess(ndo, p, l2info.length) != 0) /* last try - vcmux encaps ? */ return l2info.header_len; return l2info.header_len; }
u_int juniper_atm2_print(const struct pcap_pkthdr *h, register const u_char *p) { u_int16_t extracted_ethertype; struct juniper_l2info_t l2info; l2info.pictype = DLT_JUNIPER_ATM2; if(juniper_parse_header(p, h, &l2info) == 0) return l2info.header_len; p+=l2info.header_len; if (l2info.cookie[7] & ATM2_PKT_TYPE_MASK) { oam_print(p,l2info.length,ATM_OAM_NOHEC); return l2info.header_len; } if (EXTRACT_24BITS(p) == 0xfefe03 || EXTRACT_24BITS(p) == 0xaaaa03) { if (llc_print(p, l2info.length, l2info.caplen, NULL, NULL, &extracted_ethertype) != 0) return l2info.header_len; } if (l2info.direction != JUNIPER_BPF_PKT_IN && (EXTRACT_32BITS(l2info.cookie) & ATM2_GAP_COUNT_MASK)) { ether_print(p, l2info.length, l2info.caplen); return l2info.header_len; } if (p[0] == 0x03) { isoclns_print(p + 1, l2info.length - 1, l2info.caplen - 1); return l2info.header_len; } if(juniper_ppp_heuristic_guess(p, l2info.length) != 0) return l2info.header_len; if(ip_heuristic_guess(p, l2info.length) != 0) return l2info.header_len; return l2info.header_len; }
u_int juniper_atm1_print(const struct pcap_pkthdr *h, register const u_char *p) { u_int16_t extracted_ethertype; struct juniper_l2info_t l2info; l2info.pictype = DLT_JUNIPER_ATM1; if(juniper_parse_header(p, h, &l2info) == 0) return l2info.header_len; p+=l2info.header_len; if (l2info.cookie[0] == 0x80) { oam_print(p,l2info.length,ATM_OAM_NOHEC); return l2info.header_len; } if (EXTRACT_24BITS(p) == 0xfefe03 || EXTRACT_24BITS(p) == 0xaaaa03) { if (llc_print(p, l2info.length, l2info.caplen, NULL, NULL, &extracted_ethertype) != 0) return l2info.header_len; } if (p[0] == 0x03) { isoclns_print(p + 1, l2info.length - 1, l2info.caplen - 1); return l2info.header_len; } if(ip_heuristic_guess(p, l2info.length) != 0) return l2info.header_len; return l2info.header_len; }
u_int juniper_atm1_print(const struct pcap_pkthdr *h, register const u_char *p) { u_int16_t extracted_ethertype; struct juniper_l2info_t l2info; l2info.pictype = DLT_JUNIPER_ATM1; if(juniper_parse_header(p, h, &l2info) == 0) return l2info.header_len; p+=l2info.header_len; if (l2info.cookie[0] == 0x80) { /* OAM cell ? */ oam_print(p,l2info.length,ATM_OAM_NOHEC); return l2info.header_len; } if (EXTRACT_24BITS(p) == 0xfefe03 || /* NLPID encaps ? */ EXTRACT_24BITS(p) == 0xaaaa03) { /* SNAP encaps ? */ if (llc_print(p, l2info.length, l2info.caplen, NULL, NULL, &extracted_ethertype) != 0) return l2info.header_len; } if (p[0] == 0x03) { /* Cisco style NLPID encaps ? */ isoclns_print(p + 1, l2info.length - 1, l2info.caplen - 1); /* FIXME check if frame was recognized */ return l2info.header_len; } if(ip_heuristic_guess(p, l2info.length) != 0) /* last try - vcmux encaps ? */ return l2info.header_len; return l2info.header_len; }