• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/contrib/ngatm/netnatm/msg/

Lines Matching refs:msg

29  * $Begemot: libunimsg/netnatm/msg/uni_ie.c,v 1.16 2005/05/23 12:06:30 brandt_h Exp $
45 #include <netnatm/msg/unistruct.h>
46 #include <netnatm/msg/unimsglib.h>
47 #include <netnatm/msg/uniprint.h>
48 #include <netnatm/msg/priv.h>
62 int uni_ie_encode_##Coding##_##IE(struct uni_msg *msg, struct uni_ie_##IE *ie, struct unicx *cx)
65 int uni_ie_decode_##Coding##_##IE(struct uni_ie_##IE *ie, struct uni_msg *msg, u_int ielen, struct unicx *cx)
137 if (uni_encode_ie_hdr(msg, CODE, &ie->h, (LEN), cx)) \
140 ielen = msg->b_wptr - msg->b_rptr - 2;
147 if (uni_encode_ie_hdr(msg, REALCODE, &ie->h, (LEN), cx)) \
150 ielen = msg->b_wptr - msg->b_rptr - 2;
187 ie->F = *msg->b_rptr++ << 16; \
188 ie->F |= *msg->b_rptr++ << 8; \
189 ie->F |= *msg->b_rptr++; \
191 msg->b_rptr += 3; \
201 ie->F = *msg->b_rptr++; \
203 msg->b_rptr++; \
214 uni_encode_msg_hdr(struct uni_msg *msg, struct uni_msghdr *h,
219 if (uni_msg_ensure(msg, 9) != 0)
222 APP_BYTE(msg, cx->pnni ? PNNI_PROTO : UNI_PROTO);
223 APP_BYTE(msg, 3);
226 APP_24BIT(msg, h->cref.cref | (h->cref.flag ? 0x800000 : 0));
227 APP_BYTE(msg, type);
234 APP_BYTE(msg, byte);
236 *mlen = msg->b_wptr - msg->b_rptr;
237 APP_16BIT(msg, 0);
450 MKT(UNI_IEACT_MSG_IGNORE, ignore-msg),
451 MKT(UNI_IEACT_MSG_REPORT, report-msg),
532 struct uni_msg *msg, struct unicx *cx, u_int *ielen)
542 if ((len = uni_msg_len(msg)) == 0)
545 *ietype = *msg->b_rptr++;
550 hdr->coding = (*msg->b_rptr >> 5) & 3;
553 switch (*msg->b_rptr & 0x17) {
557 hdr->act = *msg->b_rptr & 0x7;
570 if (cx->pnni && (*msg->b_rptr & 0x08))
574 msg->b_rptr++;
582 msg->b_rptr += len;
587 *ielen = *msg->b_rptr++ << 8;
588 *ielen |= *msg->b_rptr++;
598 struct uni_msg *msg, u_int ielen, struct unicx *cx)
604 if (ielen > uni_msg_len(msg)) {
609 msg->b_rptr = msg->b_wptr;
619 msg->b_rptr += ielen;
629 msg->b_rptr += iedecl->maxlen;
634 end = msg->b_rptr + ielen;
635 ret = (*iedecl->decode)(ie, msg, ielen, cx);
636 msg->b_rptr = end;
642 uni_encode_ie(enum uni_ietype code, struct uni_msg *msg, union uni_ieall *ie,
649 return (iedecl->encode(msg, ie, cx));
653 uni_encode_ie_hdr(struct uni_msg *msg, enum uni_ietype type,
658 if (uni_msg_ensure(msg, 4 + len) != 0)
660 *msg->b_wptr++ = type;
667 *msg->b_wptr++ = byte;
670 *msg->b_wptr++ = 0;
671 *msg->b_wptr++ = 4;
674 *msg->b_wptr++ = 0;
675 *msg->b_wptr++ = 0;
729 uni_print_internal(const struct uni_all *msg, struct unicx *cx)
732 if(msg->mtype >= 256 || uni_msgtable[msg->mtype] == NULL) {
733 uni_printf(cx, "0x%02x(ERROR)", msg->mtype);
735 uni_printf(cx, "%s", uni_msgtable[msg->mtype]->name);
736 uni_print_msghdr_internal(&msg->u.hdr, cx);
739 (*uni_msgtable[msg->mtype]->print)(&msg->u, cx);
755 uni_print_msg_internal(u_int mtype, const union uni_msgall *msg,
764 uni_print_msghdr_internal(&msg->hdr, cx);
767 (*uni_msgtable[mtype]->print)(msg, cx);
830 #include <netnatm/msg/uni_ietab.h>
1345 encode_cause(struct uni_msg *msg, struct uni_ie_cause *ie, struct unicx *cx)
1352 APP_BYTE(msg, 0x00 | ie->loc);
1354 APP_BYTE(msg, 0x80 | ie->loc);
1356 APP_BYTE(msg, 0x80 | ie->cause);
1359 APP_BYTE(msg, 0x80 | (ie->u.cond.pu << 3) |
1363 APP_BYTE(msg, 0x80 | (ie->u.rej.reason << 2) | ie->u.rej.cond);
1365 APP_BYTE(msg, ie->u.rej.user);
1367 APP_BYTE(msg, ie->u.rej.ie);
1370 APP_BUF(msg, ie->u.ie.ie, ie->u.ie.len);
1373 APP_BUF(msg, ie->u.traffic.traffic, ie->u.traffic.len);
1376 APP_BYTE(msg, (ie->u.vpci.vpci >> 8));
1377 APP_BYTE(msg, (ie->u.vpci.vpci >> 0));
1378 APP_BYTE(msg, (ie->u.vpci.vci >> 8));
1379 APP_BYTE(msg, (ie->u.vpci.vci >> 0));
1382 APP_BYTE(msg, ie->u.mtype);
1385 APP_BYTE(msg, ie->u.timer[0]);
1386 APP_BYTE(msg, ie->u.timer[1]);
1387 APP_BYTE(msg, ie->u.timer[2]);
1390 uni_encode_ie(UNI_IE_TNS, msg,
1394 uni_encode_ie(UNI_IE_CALLED, msg,
1399 APP_BYTE(msg, ie->u.attr.attr[i][0]);
1401 APP_BYTE(msg, ie->u.attr.attr[i][1]);
1403 APP_BYTE(msg, ie->u.attr.attr[i][2]);
1407 APP_BYTE(msg, ie->u.param);
1409 SET_IE_LEN(msg);
1416 return encode_cause(msg, ie, cx);
1420 return encode_cause(msg, ie, cx);
1426 decode_cause(struct uni_ie_cause *ie, struct uni_msg *msg, u_int ielen,
1439 c = *msg->b_rptr++;
1445 c = *msg->b_rptr++;
1469 c = *msg->b_rptr++;
1484 c = *msg->b_rptr++;
1495 c = *msg->b_rptr++;
1518 *msg->b_rptr++;
1526 ie->u.ie.ie[ie->u.ie.len++] = *msg->b_rptr++;
1535 ie->u.vpci.vpci = *msg->b_rptr++ << 8;
1536 ie->u.vpci.vpci |= *msg->b_rptr++;
1537 ie->u.vpci.vci = *msg->b_rptr++ << 8;
1538 ie->u.vpci.vci |= *msg->b_rptr++;
1544 ie->u.mtype = *msg->b_rptr++;
1552 ie->u.timer[0] = *msg->b_rptr++;
1553 ie->u.timer[1] = *msg->b_rptr++;
1554 ie->u.timer[2] = *msg->b_rptr++;
1561 if(uni_decode_ie_hdr(&ietype, &ie->u.tns.h, msg, cx, &xielen))
1566 (union uni_ieall *)&ie->u.tns, msg, xielen, cx))
1574 if(uni_decode_ie_hdr(&ietype, &ie->u.number.h, msg, cx, &xielen))
1579 (union uni_ieall *)&ie->u.number, msg, xielen, cx))
1587 c = *msg->b_rptr++;
1591 c = *msg->b_rptr++;
1595 c = *msg->b_rptr++;
1605 ie->u.param = *msg->b_rptr++;
1616 return decode_cause(ie, msg, ielen, cx, itu_causes, NULL);
1620 return decode_cause(ie, msg, ielen, cx, net_causes, itu_causes);
1694 APP_BYTE(msg, ie->state);
1696 SET_IE_LEN(msg);
1707 ie->state = *msg->b_rptr++ & 0x3f;
1761 APP_BYTE(msg, ie->proto | 0x80);
1762 APP_BUF(msg, ie->apdu, ie->len);
1764 SET_IE_LEN(msg);
1777 ie->proto = (c = *msg->b_rptr++) & 0x1f;
1784 (void)memcpy(ie->apdu, msg->b_rptr, ie->len);
1785 msg->b_rptr += ie->len;
1830 APP_BUF(msg, ie->notify, ie->len);
1836 APP_BYTE(msg, 0x00);
1841 SET_IE_LEN(msg);
1854 (void)memcpy(ie->notify, msg->b_rptr, ie->len);
1855 msg->b_rptr += ie->len;
1943 APP_BYTE(msg, UNI_EETD_CTD_ID);
1944 APP_16BIT(msg, ie->cumulative);
1947 APP_BYTE(msg, UNI_EETD_MTD_ID);
1948 APP_16BIT(msg, ie->maximum);
1951 APP_BYTE(msg, UNI_EETD_PMTD_ID);
1952 APP_24BIT(msg, ie->pmtd);
1955 APP_BYTE(msg, UNI_EETD_PCTD_ID);
1956 APP_24BIT(msg, ie->pctd);
1959 APP_BYTE(msg, UNI_EETD_NET_ID);
1962 SET_IE_LEN(msg);
1968 return (uni_ie_encode_itu_eetd(msg, ie, cx));
1976 switch (ielen--, *msg->b_rptr++) {
1982 ie->cumulative = *msg->b_rptr++ << 8;
1983 ie->cumulative |= *msg->b_rptr++;
1991 ie->maximum = *msg->b_rptr++ << 8;
1992 ie->maximum |= *msg->b_rptr++;
2000 ie->pctd = *msg->b_rptr++ << 16;
2001 ie->pctd |= *msg->b_rptr++ << 8;
2002 ie->pctd |= *msg->b_rptr++;
2010 ie->pmtd = *msg->b_rptr++ << 16;
2011 ie->pmtd |= *msg->b_rptr++ << 8;
2012 ie->pmtd |= *msg->b_rptr++;
2029 return (uni_ie_decode_itu_eetd(ie, msg, ielen, cx));
2212 encode_addr(struct uni_msg *msg, struct uni_addr *addr, u_int flag,
2218 APP_BYTE(msg, (addr->type << 4) | addr->plan);
2219 APP_BYTE(msg, ext | (pres << 5) | (screen));
2221 APP_BYTE(msg, ext | (addr->type << 4) | addr->plan);
2223 APP_BUF(msg, addr->addr, addr->len);
2227 encode_subaddr(struct uni_msg *msg, struct uni_subaddr *addr)
2229 APP_BYTE(msg, 0x80|(addr->type<<4));
2230 APP_BUF(msg, addr->addr, addr->len);
2234 decode_addr(struct uni_addr *addr, u_int ielen, struct uni_msg *msg, u_int plan)
2255 (void)memcpy(addr->addr, msg->b_rptr, ielen);
2257 msg->b_rptr += ielen;
2263 decode_subaddr(struct uni_subaddr *addr, u_int ielen, struct uni_msg *msg,
2287 (void)memcpy(addr->addr, msg->b_rptr, ielen);
2288 msg->b_rptr += ielen;
2315 encode_addr(msg, &ie->addr, 0, 0, 0, IE_ISERROR(*ie));
2316 SET_IE_LEN(msg);
2328 c = *msg->b_rptr++;
2334 if (decode_addr(&ie->addr, ielen, msg, c))
2362 encode_subaddr(msg, &ie->addr);
2363 SET_IE_LEN(msg);
2376 c = *msg->b_rptr++;
2379 if(decode_subaddr(&ie->addr, ielen, msg, c))
2417 encode_addr(msg, &ie->addr, ie->h.present & UNI_CALLING_SCREEN_P, ie->screen, ie->pres, IE_ISERROR(*ie));
2418 SET_IE_LEN(msg);
2431 plan = *msg->b_rptr++;
2438 c = *msg->b_rptr++;
2448 if(decode_addr(&ie->addr, ielen, msg, plan))
2476 encode_subaddr(msg, &ie->addr);
2477 SET_IE_LEN(msg);
2490 c = *msg->b_rptr++;
2493 if(decode_subaddr(&ie->addr, ielen, msg, c))
2531 encode_addr(msg, &ie->addr, ie->h.present & UNI_CONNED_SCREEN_P, ie->screen, ie->pres, IE_ISERROR(*ie));
2532 SET_IE_LEN(msg);
2545 plan = *msg->b_rptr++;
2552 c = *msg->b_rptr++;
2562 if(decode_addr(&ie->addr, ielen, msg, plan))
2590 encode_subaddr(msg, &ie->addr);
2591 SET_IE_LEN(msg);
2604 c = *msg->b_rptr++;
2607 if(decode_subaddr(&ie->addr, ielen, msg, c))
2647 APP_BYTE(msg, 0xff);
2649 APP_BYTE(msg, 0);
2650 APP_BYTE(msg, (ie->flag << 7) | ((ie->epref >> 8) & 0x7f));
2651 APP_BYTE(msg, (ie->epref & 0xff));
2653 SET_IE_LEN(msg);
2665 if(*msg->b_rptr++ != 0)
2668 c = *msg->b_rptr++;
2671 ie->epref |= *msg->b_rptr++;
2733 APP_BYTE(msg, ie->state);
2735 SET_IE_LEN(msg);
2746 ie->state = *msg->b_rptr++ & 0x3f;
3040 APP_BYTE(msg, ie->type);
3047 APP_SUB_BYTE(msg,
3049 APP_SUB_BYTE(msg,
3051 APP_OPT_16BIT(msg, ie->h.present, UNI_AAL1_MULT_P,
3053 APP_OPT_BYTE(msg, ie->h.present, UNI_AAL1_SCREC_P,
3055 APP_OPT_BYTE(msg, ie->h.present, UNI_AAL1_ECM_P,
3057 APP_OPT_16BIT(msg, ie->h.present, UNI_AAL1_BSIZE_P,
3059 APP_OPT_BYTE(msg, ie->h.present, UNI_AAL1_PART_P,
3068 APP_SUB_16BIT(msg,
3070 APP_SUB_16BIT(msg,
3074 APP_BYTE(msg, UNI_AAL_MID_ID);
3075 APP_16BIT(msg, ie->u.aal4.mid_low);
3076 APP_16BIT(msg, ie->u.aal4.mid_high);
3078 APP_OPT_BYTE(msg, ie->h.present, UNI_AAL4_SSCS_P,
3084 APP_SUB_16BIT(msg,
3086 APP_SUB_16BIT(msg,
3089 APP_OPT_BYTE(msg, ie->h.present, UNI_AAL5_SSCS_P,
3094 APP_BUF(msg, ie->u.aalu.user, ie->u.aalu.len);
3101 SET_IE_LEN(msg);
3110 decode_aal_1(struct uni_ie_aal *ie, struct uni_msg *msg, u_int ielen)
3117 switch(*msg->b_rptr++) {
3124 ie->u.aal1.subtype = *msg->b_rptr++;
3132 ie->u.aal1.cbr_rate = *msg->b_rptr++;
3140 ie->u.aal1.mult = *msg->b_rptr++ << 8;
3141 ie->u.aal1.mult |= *msg->b_rptr++;
3149 ie->u.aal1.screc = *msg->b_rptr++;
3157 ie->u.aal1.ecm = *msg->b_rptr++;
3165 ie->u.aal1.bsize = *msg->b_rptr++ << 8;
3166 ie->u.aal1.bsize |= *msg->b_rptr++;
3174 ie->u.aal1.part = *msg->b_rptr++;
3188 decode_aal_4(struct uni_ie_aal *ie, struct uni_msg *msg, u_int ielen)
3195 switch(*msg->b_rptr++) {
3202 ie->u.aal4.fwd_cpcs = *msg->b_rptr++ << 8;
3203 ie->u.aal4.fwd_cpcs |= *msg->b_rptr++;
3211 ie->u.aal4.bwd_cpcs = *msg->b_rptr++ << 8;
3212 ie->u.aal4.bwd_cpcs |= *msg->b_rptr++;
3220 ie->u.aal4.mid_low = *msg->b_rptr++ << 8;
3221 ie->u.aal4.mid_low |= *msg->b_rptr++;
3222 ie->u.aal4.mid_high = *msg->b_rptr++ << 8;
3223 ie->u.aal4.mid_high |= *msg->b_rptr++;
3231 ie->u.aal4.sscs = *msg->b_rptr++;
3248 decode_aal_5(struct uni_ie_aal *ie, struct uni_msg *msg, u_int ielen)
3255 switch(*msg->b_rptr++) {
3262 ie->u.aal5.fwd_cpcs = *msg->b_rptr++ << 8;
3263 ie->u.aal5.fwd_cpcs |= *msg->b_rptr++;
3271 ie->u.aal5.bwd_cpcs = *msg->b_rptr++ << 8;
3272 ie->u.aal5.bwd_cpcs |= *msg->b_rptr++;
3280 ie->u.aal5.sscs = *msg->b_rptr++;
3297 decode_aal_user(struct uni_ie_aal *ie, struct uni_msg *msg, u_int ielen)
3304 ie->u.aalu.user[ie->u.aalu.len++] = *msg->b_rptr++;
3318 c = *msg->b_rptr++;
3329 if(decode_aal_1(ie, msg, ielen))
3339 if(decode_aal_4(ie, msg, ielen))
3345 if(decode_aal_5(ie, msg, ielen))
3351 if(decode_aal_user(ie, msg, ielen))
3587 encode_traffic_common(struct uni_msg *msg, struct uni_xtraffic *ie,
3590 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_FPCR0_P,
3592 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_BPCR0_P,
3594 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_FPCR1_P,
3596 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_BPCR1_P,
3598 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_FSCR0_P,
3600 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_BSCR0_P,
3602 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_FSCR1_P,
3604 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_BSCR1_P,
3606 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_FMBS0_P,
3608 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_BMBS0_P,
3610 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_FMBS1_P,
3612 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_BMBS1_P,
3614 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_FABR1_P,
3616 APP_OPT_24BIT(msg, present, UNI_TRAFFIC_BABR1_P,
3619 APP_OPT(msg, present, UNI_TRAFFIC_BEST_P,
3621 APP_OPT_BYTE(msg, present, UNI_TRAFFIC_MOPT_P,
3632 decode_traffic_common(struct uni_xtraffic *ie, struct uni_msg *msg,
3638 switch(c = *msg->b_rptr++) {
3668 ie->ftag = (*msg->b_rptr&UNI_TRAFFIC_FTAG)?1:0;
3669 ie->btag = (*msg->b_rptr&UNI_TRAFFIC_BTAG)?1:0;
3670 ie->fdisc = (*msg->b_rptr&UNI_TRAFFIC_FDISC)?1:0;
3671 ie->bdisc = (*msg->b_rptr&UNI_TRAFFIC_BDISC)?1:0;
3673 msg->b_rptr++;
3699 encode_traffic_common(msg, &ie->t, ie->h.present, cx);
3700 SET_IE_LEN(msg);
3711 if(decode_traffic_common(&ie->t, msg, ielen, &ie->h.present))
3735 encode_traffic_common(msg, &ie->t, ie->h.present, cx);
3736 SET_IE_LEN(msg);
3747 if(decode_traffic_common(&ie->t, msg, ielen, &ie->h.present))
3807 APP_OPT_24BIT(msg, ie->h.present, UNI_MINTRAFFIC_FPCR0_P,
3809 APP_OPT_24BIT(msg, ie->h.present, UNI_MINTRAFFIC_BPCR0_P,
3811 APP_OPT_24BIT(msg, ie->h.present, UNI_MINTRAFFIC_FPCR1_P,
3813 APP_OPT_24BIT(msg, ie->h.present, UNI_MINTRAFFIC_BPCR1_P,
3815 APP_OPT_24BIT(msg, ie->h.present, UNI_MINTRAFFIC_FABR1_P,
3817 APP_OPT_24BIT(msg, ie->h.present, UNI_MINTRAFFIC_BABR1_P,
3820 SET_IE_LEN(msg);
3834 switch(c = *msg->b_rptr++) {
3890 APP_BYTE(msg, ie->origin);
3891 APP_SUB_24BIT(msg, UNI_TRAFFIC_FMDCR_ID, ie->fmdcr);
3892 APP_SUB_24BIT(msg, UNI_TRAFFIC_BMDCR_ID, ie->bmdcr);
3894 SET_IE_LEN(msg);
3910 ie->origin = *msg->b_rptr++;
3914 switch(c = *msg->b_rptr++) {
4008 APP_BYTE(msg, 0x80 | (ie->assoc << 3) | ie->type);
4009 APP_BYTE(msg, ie->vpci >> 8);
4010 APP_BYTE(msg, ie->vpci >> 0);
4011 APP_BYTE(msg, ie->vci >> 8);
4012 APP_BYTE(msg, ie->vci >> 0);
4014 SET_IE_LEN(msg);
4027 c = *msg->b_rptr++;
4032 ie->vpci = *msg->b_rptr++ << 8;
4033 ie->vpci |= *msg->b_rptr++;
4034 ie->vci = *msg->b_rptr++ << 8;
4035 ie->vci |= *msg->b_rptr++;
4132 APP_BYTE(msg, ie->fwd);
4133 APP_BYTE(msg, ie->bwd);
4135 SET_IE_LEN(msg);
4142 APP_BYTE(msg, ie->fwd);
4143 APP_BYTE(msg, ie->bwd);
4145 SET_IE_LEN(msg);
4156 ie->fwd = *msg->b_rptr++;
4157 ie->bwd = *msg->b_rptr++;
4169 ie->fwd = *msg->b_rptr++;
4170 ie->bwd = *msg->b_rptr++;
4233 APP_BYTE(msg, 0x80 | ie->type);
4234 APP_BUF(msg, ie->info, ie->len);
4236 SET_IE_LEN(msg);
4249 c = *msg->b_rptr++;
4256 (void)memcpy(ie->info, msg->b_rptr, ielen);
4257 msg->b_rptr += ielen;
4439 APP_BYTE(msg, ie->bclass |
4441 APP_OPT(msg, ie->h.present, UNI_BEARER_ATC_P,
4443 APP_BYTE(msg, 0x80 | (ie->clip << 5) | ie->cfg);
4445 SET_IE_LEN(msg);
4458 c = *msg->b_rptr++;
4462 c = *msg->b_rptr++;
4501 c = *msg->b_rptr++;
4915 APP_BYTE(msg, 0xff);
4916 APP_BYTE(msg, 0xff);
4921 APP_BYTE(msg, (UNI_BLLI_L1_ID<<5)|ie->l1|0x80);
4925 APP_BYTE(msg, (UNI_BLLI_L2_ID<<5)|ie->l2);
4927 APP_BYTE(msg, (ie->l2_mode<<5)|ie->l2_q933);
4928 APP_BYTE(msg, ie->l2_wsiz | 0x80);
4930 APP_BYTE(msg, (ie->l2_mode<<5)|ie->l2_q933|0x80);
4933 APP_BYTE(msg, (UNI_BLLI_L2_ID<<5)|ie->l2);
4934 APP_BYTE(msg, ie->l2_user | 0x80);
4936 APP_BYTE(msg, (UNI_BLLI_L2_ID << 5) | ie->l2 | 0x80);
4944 APP_BYTE(msg,(UNI_BLLI_L3_ID<<5)|ie->l3);
4945 APP_BYTE(msg,(ie->l3_mode<<5));
4946 APP_BYTE(msg,ie->l3_psiz);
4947 APP_BYTE(msg,ie->l3_wsiz|0x80);
4949 APP_BYTE(msg,(UNI_BLLI_L3_ID<<5)|ie->l3);
4950 APP_BYTE(msg,(ie->l3_mode<<5));
4951 APP_BYTE(msg,(ie->l3_psiz|0x80));
4954 APP_BYTE(msg, (UNI_BLLI_L3_ID<<5)|ie->l3);
4955 APP_BYTE(msg, (ie->l3_mode<<5)|0x80);
4958 APP_BYTE(msg, (UNI_BLLI_L3_ID<<5)|ie->l3);
4959 APP_BYTE(msg,(ie->l3_user|0x80));
4961 APP_BYTE(msg, (UNI_BLLI_L3_ID<<5)|ie->l3);
4962 APP_BYTE(msg,((ie->l3_ipi>>1) & 0x7f));
4963 APP_BYTE(msg,(((ie->l3_ipi&1)<<6)|0x80));
4965 APP_BYTE(msg, 0x80);
4966 APP_BYTE(msg, (ie->oui >> 16));
4967 APP_BYTE(msg, (ie->oui >> 8));
4968 APP_BYTE(msg, (ie->oui >> 0));
4969 APP_BYTE(msg, (ie->pid >> 8));
4970 APP_BYTE(msg, (ie->pid >> 0));
4974 APP_BYTE(msg, ie->l3_ttype | (ie->l3_tcap << 4));
4975 APP_BYTE(msg, 0x80 | (ie->l3_fmux << 3) | ie->l3_bmux);
4977 APP_BYTE(msg, 0x80 | ie->l3_ttype | (ie->l3_tcap << 4));
4980 APP_BYTE(msg, (UNI_BLLI_L3_ID<<5)|ie->l3|0x80);
4985 SET_IE_LEN(msg);
4999 switch(((c = *msg->b_rptr++) >> 5) & 0x3) {
5017 c = *msg->b_rptr++;
5031 c = *msg->b_rptr++;
5057 c = *msg->b_rptr++;
5067 c = *msg->b_rptr++;
5077 c = *msg->b_rptr++;
5089 c = *msg->b_rptr++;
5093 c = *msg->b_rptr++;
5104 if(*msg->b_rptr++ != 0x80)
5107 ie->oui = *msg->b_rptr++ << 16;
5108 ie->oui |= *msg->b_rptr++ << 8;
5109 ie->oui |= *msg->b_rptr++;
5110 ie->pid = *msg->b_rptr++ << 8;
5111 ie->pid |= *msg->b_rptr++;
5118 c = *msg->b_rptr++;
5127 c = *msg->b_rptr++;
5139 c = *msg->b_rptr++;
5185 APP_BYTE(msg, 0x80 | ie->set);
5186 SET_IE_LEN(msg);
5199 c = *msg->b_rptr++;
5226 APP_BYTE(msg, 0x80 | ie->set);
5227 SET_IE_LEN(msg);
5240 c = *msg->b_rptr++;
5276 APP_BYTE(msg, 0x80 | 0x21);
5278 SET_IE_LEN(msg);
5289 if(*msg->b_rptr++ != (0x80 | 0x21))
5344 APP_BYTE(msg, 0x80 | ie->type);
5346 SET_IE_LEN(msg);
5359 c = *msg->b_rptr++;
5419 APP_BYTE(msg, 0x80 | (0x2 << 4) | 0x1);
5420 APP_BUF(msg, ie->net, ie->len);
5422 SET_IE_LEN(msg);
5433 if(*msg->b_rptr++ != (0x80 | (0x2 << 4) | 0x1))
5439 ie->net[ie->len++] = *msg->b_rptr++;
5492 APP_BYTE(msg, 0x80 | ie->rclass);
5494 SET_IE_LEN(msg);
5507 ie->rclass = (c = *msg->b_rptr++) & 0x7;
5554 APP_BUF(msg, ie->uu, ie->len);
5556 SET_IE_LEN(msg);
5569 (void)memcpy(ie->uu, msg->b_rptr, ie->len);
5570 msg->b_rptr += ie->len;
5667 APP_BYTE(msg, ie->std);
5669 APP_BYTE(msg, ie->sub[i].type);
5670 APP_BYTE(msg, ie->sub[i].len);
5671 APP_BUF(msg, ie->sub[i].val, ie->sub[i].len);
5674 SET_IE_LEN(msg);
5685 ie->std = *msg->b_rptr++;
5693 ie->sub[ie->numsub].type = *msg->b_rptr++;
5698 ie->sub[ie->numsub].len = *msg->b_rptr++;
5706 (void)memcpy(ie->sub[ie->numsub].val, msg->b_rptr, ie->sub[ie->numsub].len);
5708 msg->b_rptr += ie->sub[ie->numsub].len;
5788 APP_SUB_32BIT(msg, UNI_ABRADD_FADD_ID, encode_abr_rec(&ie->fwd));
5789 APP_SUB_32BIT(msg, UNI_ABRADD_BADD_ID, encode_abr_rec(&ie->bwd));
5791 SET_IE_LEN(msg);
5796 decode_abr_rec(struct uni_msg *msg, struct uni_abr_rec *rec)
5800 val = *msg->b_rptr++ << 24;
5801 val |= *msg->b_rptr++ << 16;
5802 val |= *msg->b_rptr++ << 8;
5803 val |= *msg->b_rptr++ << 0;
5824 switch(*msg->b_rptr++) {
5830 if(decode_abr_rec(msg, &ie->fwd))
5836 if(decode_abr_rec(msg, &ie->bwd))
5941 APP_OPT_24BIT(msg, ie->h.present, UNI_ABRSETUP_FICR_P,
5943 APP_OPT_24BIT(msg, ie->h.present, UNI_ABRSETUP_BICR_P,
5945 APP_OPT_24BIT(msg, ie->h.present, UNI_ABRSETUP_FTBE_P,
5947 APP_OPT_24BIT(msg, ie->h.present, UNI_ABRSETUP_BTBE_P,
5949 APP_SUB_24BIT(msg, UNI_ABRSETUP_RMFRT_ID, ie->rmfrt);
5950 APP_OPT_BYTE(msg, ie->h.present, UNI_ABRSETUP_FRIF_P,
5952 APP_OPT_BYTE(msg, ie->h.present, UNI_ABRSETUP_BRIF_P,
5954 APP_OPT_BYTE(msg, ie->h.present, UNI_ABRSETUP_FRDF_P,
5956 APP_OPT_BYTE(msg, ie->h.present, UNI_ABRSETUP_BRDF_P,
5959 SET_IE_LEN(msg);
5972 switch(*msg->b_rptr++) {
6043 APP_BYTE(msg, ie->report);
6045 SET_IE_LEN(msg);
6055 ie->report = *msg->b_rptr++;
6146 APP_BYTE(msg, 0x81);
6147 APP_16BIT(msg, ie->vpi);
6150 APP_BYTE(msg, 0x82);
6151 APP_16BIT(msg, ie->vci);
6154 SET_IE_LEN(msg);
6162 APP_BYTE(msg, ie->sel);
6165 APP_BYTE(msg, 0x81);
6166 APP_16BIT(msg, ie->vpi);
6170 APP_BYTE(msg, 0x82);
6171 APP_16BIT(msg, ie->vci);
6174 SET_IE_LEN(msg);
6190 switch(*msg->b_rptr++) {
6194 ie->vpi = *msg->b_rptr++ << 8;
6195 ie->vpi |= *msg->b_rptr++;
6197 msg->b_rptr += 2;
6204 ie->vci = *msg->b_rptr++ << 8;
6205 ie->vci |= *msg->b_rptr++;
6207 msg->b_rptr += 2;
6236 switch(*msg->b_rptr++) {
6240 ie->vpi = *msg->b_rptr++ << 8;
6241 ie->vpi |= *msg->b_rptr++;
6244 msg->b_rptr += 2;
6252 ie->vci = *msg->b_rptr++ << 8;
6253 ie->vci |= *msg->b_rptr++;
6256 msg->b_rptr += 2;
6414 APP_BYTE(msg, ie->level);
6415 APP_BYTE(msg, ie->type);
6423 APP_BYTE(msg, ie->id.node.level);
6424 APP_BUF(msg, ie->id.node.id, 21);
6428 APP_BYTE(msg, ie->id.link.plevel);
6429 APP_BUF(msg, ie->id.link.pid, 21);
6430 APP_32BIT(msg, ie->id.link.port);
6431 APP_BYTE(msg, ie->id.link.slevel);
6432 APP_BUF(msg, ie->id.link.sid, 21);
6436 APP_BYTE(msg, ie->cause);
6439 APP_BYTE(msg, ie->diag.top.dir);
6440 APP_32BIT(msg, ie->diag.top.port);
6441 APP_32BIT(msg, ie->diag.top.avcr);
6443 APP_32BIT(msg, ie->diag.top.crm);
6444 APP_32BIT(msg, ie->diag.top.vf);
6449 APP_BYTE(msg, (ie->diag.qos.ctd << 3)
6454 SET_IE_LEN(msg);
6466 ie->level = *msg->b_rptr++;
6469 ie->type = *msg->b_rptr++;
6483 ie->id.node.level = *msg->b_rptr++;
6484 (void)memcpy(ie->id.node.id, msg->b_rptr, 21);
6485 msg->b_rptr += 21;
6492 ie->id.link.plevel = *msg->b_rptr++;
6493 (void)memcpy(ie->id.link.pid, msg->b_rptr, 21);
6494 msg->b_rptr += 21;
6497 ie->id.link.port = *msg->b_rptr++ << 24;
6498 ie->id.link.port |= *msg->b_rptr++ << 16;
6499 ie->id.link.port |= *msg->b_rptr++ << 8;
6500 ie->id.link.port |= *msg->b_rptr++ << 0;
6503 ie->id.link.slevel = *msg->b_rptr++;
6504 (void)memcpy(ie->id.link.sid, msg->b_rptr, 21);
6505 msg->b_rptr += 21;
6513 ie->cause = *msg->b_rptr++;
6520 ie->diag.top.dir = *msg->b_rptr++;
6521 ie->diag.top.port = *msg->b_rptr++ << 24;
6522 ie->diag.top.port |= *msg->b_rptr++ << 16;
6523 ie->diag.top.port |= *msg->b_rptr++ << 8;
6524 ie->diag.top.port |= *msg->b_rptr++ << 0;
6525 ie->diag.top.avcr = *msg->b_rptr++ << 24;
6526 ie->diag.top.avcr |= *msg->b_rptr++ << 16;
6527 ie->diag.top.avcr |= *msg->b_rptr++ << 8;
6528 ie->diag.top.avcr |= *msg->b_rptr++ << 0;
6532 ie->diag.top.crm = *msg->b_rptr++ << 24;
6533 ie->diag.top.crm |= *msg->b_rptr++ << 16;
6534 ie->diag.top.crm |= *msg->b_rptr++ << 8;
6535 ie->diag.top.crm |= *msg->b_rptr++ << 0;
6536 ie->diag.top.vf = *msg->b_rptr++ << 24;
6537 ie->diag.top.vf |= *msg->b_rptr++ << 16;
6538 ie->diag.top.vf |= *msg->b_rptr++ << 8;
6539 ie->diag.top.vf |= *msg->b_rptr++ << 0;
6548 ie->diag.qos.ctd = *msg->b_rptr >> 3;
6549 ie->diag.qos.cdv = *msg->b_rptr >> 2;
6550 ie->diag.qos.clr = *msg->b_rptr >> 1;
6551 ie->diag.qos.other = *msg->b_rptr >> 0;
6622 APP_16BIT(msg, ie->ptr);
6625 APP_BYTE(msg, UNI_DTL_LOGNP);
6626 APP_BYTE(msg, ie->dtl[i].node_level);
6627 APP_BUF(msg, ie->dtl[i].node_id, 21);
6628 APP_32BIT(msg, ie->dtl[i].port_id);
6631 SET_IE_LEN(msg);
6643 ie->ptr = *msg->b_rptr++ << 8;
6644 ie->ptr |= *msg->b_rptr++;
6654 if(*msg->b_rptr++ != UNI_DTL_LOGNP)
6658 ie->dtl[ie->num].node_level = *msg->b_rptr++;
6661 (void)memcpy(ie->dtl[ie->num].node_id, msg->b_rptr, 21);
6662 msg->b_rptr += 21;
6665 ie->dtl[ie->num].port_id = *msg->b_rptr++ << 24;
6666 ie->dtl[ie->num].port_id |= *msg->b_rptr++ << 16;
6667 ie->dtl[ie->num].port_id |= *msg->b_rptr++ << 8;
6668 ie->dtl[ie->num].port_id |= *msg->b_rptr++ << 0;
6728 APP_BYTE(msg, 0x80 | ie->type);
6729 APP_32BIT(msg, ie->callid);
6731 SET_IE_LEN(msg);
6742 ie->type = *msg->b_rptr++ & 0xf;
6743 ie->callid = *msg->b_rptr++ << 24;
6744 ie->callid |= *msg->b_rptr++ << 16;
6745 ie->callid |= *msg->b_rptr++ << 8;
6746 ie->callid |= *msg->b_rptr++ << 0;
6786 APP_BYTE(msg, 0x80 | ie->screen);
6788 SET_IE_LEN(msg);
6799 ie->screen = *msg->b_rptr++ & 0xf;
6825 APP_32BIT(msg, ie->seqno);
6827 SET_IE_LEN(msg);
6838 ie->seqno = *msg->b_rptr++ << 24;
6839 ie->seqno |= *msg->b_rptr++ << 16;
6840 ie->seqno |= *msg->b_rptr++ << 8;
6841 ie->seqno |= *msg->b_rptr++ << 0;
6934 APP_BYTE(msg, ie->type | 0x80);
6935 APP_BYTE(msg, ie->scope);
6937 SET_IE_LEN(msg);
6947 if((*msg->b_rptr & 0xf0) != 0x80)
6950 ie->type = *msg->b_rptr++ & 0xf;
6951 ie->scope = *msg->b_rptr++;
7068 APP_BYTE(msg, ie->origin);
7070 APP_OPT_24BIT(msg, ie->h.present, UNI_EXQOS_FACC_P,
7072 APP_OPT_24BIT(msg, ie->h.present, UNI_EXQOS_BACC_P,
7074 APP_OPT_24BIT(msg, ie->h.present, UNI_EXQOS_FCUM_P,
7076 APP_OPT_24BIT(msg, ie->h.present, UNI_EXQOS_BCUM_P,
7079 APP_OPT_BYTE(msg, ie->h.present, UNI_EXQOS_FCLR_P,
7081 APP_OPT_BYTE(msg, ie->h.present, UNI_EXQOS_BCLR_P,
7084 SET_IE_LEN(msg);
7095 ie->origin = *msg->b_rptr++;
7099 switch(*msg->b_rptr++) {
7149 APP_BUF(msg, ie->data, ie->len);
7151 SET_IE_LEN(msg);
7164 (void)memcpy(ie->data, msg->b_rptr, ie->len);
7165 msg->b_rptr += ie->len;