1 /* This file was created automatically
2 * Source file: $Begemot: libunimsg/atm/msg/msg.def,v 1.3 2003/09/19 11:58:15 hbb Exp $
10 #include <sys/libkern.h>
14 #include <netnatm/unimsg.h>
15 #include <netnatm/msg/unistruct.h>
16 #include <netnatm/msg/unimsglib.h>
17 #include <netnatm/msg/priv.h>
18 #include <netnatm/msg/privmsg.c>
21 print_alerting(struct uni_alerting *msg, struct unicx *cx)
25 if(msg->connid.h.present & UNI_IE_PRESENT)
26 uni_print_ie_internal(UNI_IE_CONNID, (union uni_ieall *)&msg->connid, cx);
27 if(msg->epref.h.present & UNI_IE_PRESENT)
28 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
29 if(msg->notify.h.present & UNI_IE_PRESENT)
30 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
31 for(i = 0; i < UNI_NUM_IE_GIT; i++)
32 if(msg->git[i].h.present & UNI_IE_PRESENT)
33 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
34 if(msg->uu.h.present & UNI_IE_PRESENT)
35 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
36 if(msg->report.h.present & UNI_IE_PRESENT)
37 uni_print_ie_internal(UNI_IE_REPORT, (union uni_ieall *)&msg->report, cx);
38 if(msg->unrec.h.present & UNI_IE_PRESENT)
39 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
43 check_alerting(struct uni_alerting *m, struct unicx *cx)
49 ret |= IE_ISPRESENT(m->connid);
51 ret |= uni_check_ie(UNI_IE_CONNID, (union uni_ieall *)&m->connid, cx);
52 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
53 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
54 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
55 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
58 ret |= IE_ISPRESENT(m->uu);
60 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
62 ret |= IE_ISPRESENT(m->report);
64 ret |= uni_check_ie(UNI_IE_REPORT, (union uni_ieall *)&m->report, cx);
65 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
71 encode_alerting(struct uni_msg *msg, struct uni_alerting *p, struct unicx *cx)
76 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_ALERTING, cx, &mlen))
79 if((p->connid.h.present & UNI_IE_PRESENT) &&
80 uni_encode_ie(UNI_IE_CONNID, msg, (union uni_ieall *)&p->connid, cx))
81 return (UNI_IE_CONNID);
82 if((p->epref.h.present & UNI_IE_PRESENT) &&
83 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
84 return (UNI_IE_EPREF);
85 if((p->notify.h.present & UNI_IE_PRESENT) &&
86 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
87 return (UNI_IE_NOTIFY);
88 for(i = 0; i < UNI_NUM_IE_GIT; i++)
89 if((p->git[i].h.present & UNI_IE_PRESENT) &&
90 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
91 return ((i << 16) + UNI_IE_GIT);
92 if((p->uu.h.present & UNI_IE_PRESENT) &&
93 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
95 if((p->report.h.present & UNI_IE_PRESENT) &&
96 uni_encode_ie(UNI_IE_REPORT, msg, (union uni_ieall *)&p->report, cx))
97 return (UNI_IE_REPORT);
98 if((p->unrec.h.present & UNI_IE_PRESENT) &&
99 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
100 return (UNI_IE_UNREC);
102 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
103 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
109 decode_alerting(struct uni_alerting *out, struct uni_msg *msg,
110 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
120 out->connid.h = *hdr;
121 if (hdr->present & UNI_IE_ERROR)
123 if(uni_decode_ie_body(UNI_IE_CONNID, (union uni_ieall *)&out->connid, msg, ielen, cx))
129 if (hdr->present & UNI_IE_ERROR)
131 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
136 out->notify.h = *hdr;
137 if (hdr->present & UNI_IE_ERROR)
139 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
144 for(i = 0; i < UNI_NUM_IE_GIT; i++)
145 if (!IE_ISPRESENT(out->git[i])) {
146 out->git[i].h = *hdr;
147 if (hdr->present & UNI_IE_ERROR)
149 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
159 if (hdr->present & UNI_IE_ERROR)
161 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
168 out->report.h = *hdr;
169 if (hdr->present & UNI_IE_ERROR)
171 if(uni_decode_ie_body(UNI_IE_REPORT, (union uni_ieall *)&out->report, msg, ielen, cx))
177 if (hdr->present & UNI_IE_ERROR)
179 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
189 static const struct msgdecl decl_alerting = {
192 (uni_msg_print_f)print_alerting,
193 (uni_msg_check_f)check_alerting,
194 (uni_msg_encode_f)encode_alerting,
195 (uni_msg_decode_f)decode_alerting
199 print_call_proc(struct uni_call_proc *msg, struct unicx *cx)
201 if(msg->connid.h.present & UNI_IE_PRESENT)
202 uni_print_ie_internal(UNI_IE_CONNID, (union uni_ieall *)&msg->connid, cx);
203 if(msg->epref.h.present & UNI_IE_PRESENT)
204 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
205 if(msg->notify.h.present & UNI_IE_PRESENT)
206 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
207 if(msg->unrec.h.present & UNI_IE_PRESENT)
208 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
212 check_call_proc(struct uni_call_proc *m, struct unicx *cx)
216 ret |= uni_check_ie(UNI_IE_CONNID, (union uni_ieall *)&m->connid, cx);
217 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
219 ret |= IE_ISPRESENT(m->notify);
221 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
222 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
228 encode_call_proc(struct uni_msg *msg, struct uni_call_proc *p, struct unicx *cx)
232 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_CALL_PROC, cx, &mlen))
235 if((p->connid.h.present & UNI_IE_PRESENT) &&
236 uni_encode_ie(UNI_IE_CONNID, msg, (union uni_ieall *)&p->connid, cx))
237 return (UNI_IE_CONNID);
238 if((p->epref.h.present & UNI_IE_PRESENT) &&
239 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
240 return (UNI_IE_EPREF);
241 if((p->notify.h.present & UNI_IE_PRESENT) &&
242 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
243 return (UNI_IE_NOTIFY);
244 if((p->unrec.h.present & UNI_IE_PRESENT) &&
245 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
246 return (UNI_IE_UNREC);
248 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
249 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
255 decode_call_proc(struct uni_call_proc *out, struct uni_msg *msg,
256 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
262 out->connid.h = *hdr;
263 if (hdr->present & UNI_IE_ERROR)
265 if(uni_decode_ie_body(UNI_IE_CONNID, (union uni_ieall *)&out->connid, msg, ielen, cx))
271 if (hdr->present & UNI_IE_ERROR)
273 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
280 out->notify.h = *hdr;
281 if (hdr->present & UNI_IE_ERROR)
283 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
289 if (hdr->present & UNI_IE_ERROR)
291 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
301 static const struct msgdecl decl_call_proc = {
304 (uni_msg_print_f)print_call_proc,
305 (uni_msg_check_f)check_call_proc,
306 (uni_msg_encode_f)encode_call_proc,
307 (uni_msg_decode_f)decode_call_proc
311 print_connect(struct uni_connect *msg, struct unicx *cx)
315 if(msg->aal.h.present & UNI_IE_PRESENT)
316 uni_print_ie_internal(UNI_IE_AAL, (union uni_ieall *)&msg->aal, cx);
317 if(msg->blli.h.present & UNI_IE_PRESENT)
318 uni_print_ie_internal(UNI_IE_BLLI, (union uni_ieall *)&msg->blli, cx);
319 if(msg->connid.h.present & UNI_IE_PRESENT)
320 uni_print_ie_internal(UNI_IE_CONNID, (union uni_ieall *)&msg->connid, cx);
321 if(msg->epref.h.present & UNI_IE_PRESENT)
322 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
323 if(msg->notify.h.present & UNI_IE_PRESENT)
324 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
325 if(msg->conned.h.present & UNI_IE_PRESENT)
326 uni_print_ie_internal(UNI_IE_CONNED, (union uni_ieall *)&msg->conned, cx);
327 if(msg->connedsub.h.present & UNI_IE_PRESENT)
328 uni_print_ie_internal(UNI_IE_CONNEDSUB, (union uni_ieall *)&msg->connedsub, cx);
329 if(msg->eetd.h.present & UNI_IE_PRESENT)
330 uni_print_ie_internal(UNI_IE_EETD, (union uni_ieall *)&msg->eetd, cx);
331 for(i = 0; i < UNI_NUM_IE_GIT; i++)
332 if(msg->git[i].h.present & UNI_IE_PRESENT)
333 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
334 if(msg->uu.h.present & UNI_IE_PRESENT)
335 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
336 if(msg->traffic.h.present & UNI_IE_PRESENT)
337 uni_print_ie_internal(UNI_IE_TRAFFIC, (union uni_ieall *)&msg->traffic, cx);
338 if(msg->exqos.h.present & UNI_IE_PRESENT)
339 uni_print_ie_internal(UNI_IE_EXQOS, (union uni_ieall *)&msg->exqos, cx);
340 if(msg->facility.h.present & UNI_IE_PRESENT)
341 uni_print_ie_internal(UNI_IE_FACILITY, (union uni_ieall *)&msg->facility, cx);
342 if(msg->abrsetup.h.present & UNI_IE_PRESENT)
343 uni_print_ie_internal(UNI_IE_ABRSETUP, (union uni_ieall *)&msg->abrsetup, cx);
344 if(msg->abradd.h.present & UNI_IE_PRESENT)
345 uni_print_ie_internal(UNI_IE_ABRADD, (union uni_ieall *)&msg->abradd, cx);
346 if(msg->called_soft.h.present & UNI_IE_PRESENT)
347 uni_print_ie_internal(UNI_IE_CALLED_SOFT, (union uni_ieall *)&msg->called_soft, cx);
348 if(msg->report.h.present & UNI_IE_PRESENT)
349 uni_print_ie_internal(UNI_IE_REPORT, (union uni_ieall *)&msg->report, cx);
350 if(msg->unrec.h.present & UNI_IE_PRESENT)
351 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
355 check_connect(struct uni_connect *m, struct unicx *cx)
360 ret |= uni_check_ie(UNI_IE_AAL, (union uni_ieall *)&m->aal, cx);
361 ret |= uni_check_ie(UNI_IE_BLLI, (union uni_ieall *)&m->blli, cx);
363 ret |= IE_ISPRESENT(m->connid);
365 ret |= uni_check_ie(UNI_IE_CONNID, (union uni_ieall *)&m->connid, cx);
366 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
367 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
368 ret |= uni_check_ie(UNI_IE_CONNED, (union uni_ieall *)&m->conned, cx);
369 ret |= uni_check_ie(UNI_IE_CONNEDSUB, (union uni_ieall *)&m->connedsub, cx);
370 ret |= uni_check_ie(UNI_IE_EETD, (union uni_ieall *)&m->eetd, cx);
371 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
372 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
375 ret |= IE_ISPRESENT(m->uu);
377 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
378 ret |= uni_check_ie(UNI_IE_TRAFFIC, (union uni_ieall *)&m->traffic, cx);
379 ret |= uni_check_ie(UNI_IE_EXQOS, (union uni_ieall *)&m->exqos, cx);
381 ret |= IE_ISPRESENT(m->facility);
383 ret |= uni_check_ie(UNI_IE_FACILITY, (union uni_ieall *)&m->facility, cx);
384 ret |= uni_check_ie(UNI_IE_ABRSETUP, (union uni_ieall *)&m->abrsetup, cx);
385 ret |= uni_check_ie(UNI_IE_ABRADD, (union uni_ieall *)&m->abradd, cx);
387 ret |= IE_ISPRESENT(m->called_soft);
389 ret |= uni_check_ie(UNI_IE_CALLED_SOFT, (union uni_ieall *)&m->called_soft, cx);
391 ret |= IE_ISPRESENT(m->report);
393 ret |= uni_check_ie(UNI_IE_REPORT, (union uni_ieall *)&m->report, cx);
394 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
400 encode_connect(struct uni_msg *msg, struct uni_connect *p, struct unicx *cx)
405 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_CONNECT, cx, &mlen))
408 if((p->aal.h.present & UNI_IE_PRESENT) &&
409 uni_encode_ie(UNI_IE_AAL, msg, (union uni_ieall *)&p->aal, cx))
411 if((p->blli.h.present & UNI_IE_PRESENT) &&
412 uni_encode_ie(UNI_IE_BLLI, msg, (union uni_ieall *)&p->blli, cx))
413 return (UNI_IE_BLLI);
414 if((p->connid.h.present & UNI_IE_PRESENT) &&
415 uni_encode_ie(UNI_IE_CONNID, msg, (union uni_ieall *)&p->connid, cx))
416 return (UNI_IE_CONNID);
417 if((p->epref.h.present & UNI_IE_PRESENT) &&
418 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
419 return (UNI_IE_EPREF);
420 if((p->notify.h.present & UNI_IE_PRESENT) &&
421 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
422 return (UNI_IE_NOTIFY);
423 if((p->conned.h.present & UNI_IE_PRESENT) &&
424 uni_encode_ie(UNI_IE_CONNED, msg, (union uni_ieall *)&p->conned, cx))
425 return (UNI_IE_CONNED);
426 if((p->connedsub.h.present & UNI_IE_PRESENT) &&
427 uni_encode_ie(UNI_IE_CONNEDSUB, msg, (union uni_ieall *)&p->connedsub, cx))
428 return (UNI_IE_CONNEDSUB);
429 if((p->eetd.h.present & UNI_IE_PRESENT) &&
430 uni_encode_ie(UNI_IE_EETD, msg, (union uni_ieall *)&p->eetd, cx))
431 return (UNI_IE_EETD);
432 for(i = 0; i < UNI_NUM_IE_GIT; i++)
433 if((p->git[i].h.present & UNI_IE_PRESENT) &&
434 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
435 return ((i << 16) + UNI_IE_GIT);
436 if((p->uu.h.present & UNI_IE_PRESENT) &&
437 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
439 if((p->traffic.h.present & UNI_IE_PRESENT) &&
440 uni_encode_ie(UNI_IE_TRAFFIC, msg, (union uni_ieall *)&p->traffic, cx))
441 return (UNI_IE_TRAFFIC);
442 if((p->exqos.h.present & UNI_IE_PRESENT) &&
443 uni_encode_ie(UNI_IE_EXQOS, msg, (union uni_ieall *)&p->exqos, cx))
444 return (UNI_IE_EXQOS);
445 if((p->facility.h.present & UNI_IE_PRESENT) &&
446 uni_encode_ie(UNI_IE_FACILITY, msg, (union uni_ieall *)&p->facility, cx))
447 return (UNI_IE_FACILITY);
448 if((p->abrsetup.h.present & UNI_IE_PRESENT) &&
449 uni_encode_ie(UNI_IE_ABRSETUP, msg, (union uni_ieall *)&p->abrsetup, cx))
450 return (UNI_IE_ABRSETUP);
451 if((p->abradd.h.present & UNI_IE_PRESENT) &&
452 uni_encode_ie(UNI_IE_ABRADD, msg, (union uni_ieall *)&p->abradd, cx))
453 return (UNI_IE_ABRADD);
454 if((p->called_soft.h.present & UNI_IE_PRESENT) &&
455 uni_encode_ie(UNI_IE_CALLED_SOFT, msg, (union uni_ieall *)&p->called_soft, cx))
456 return (UNI_IE_CALLED_SOFT);
457 if((p->report.h.present & UNI_IE_PRESENT) &&
458 uni_encode_ie(UNI_IE_REPORT, msg, (union uni_ieall *)&p->report, cx))
459 return (UNI_IE_REPORT);
460 if((p->unrec.h.present & UNI_IE_PRESENT) &&
461 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
462 return (UNI_IE_UNREC);
464 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
465 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
471 decode_connect(struct uni_connect *out, struct uni_msg *msg,
472 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
481 if (hdr->present & UNI_IE_ERROR)
483 if(uni_decode_ie_body(UNI_IE_AAL, (union uni_ieall *)&out->aal, msg, ielen, cx))
489 if (hdr->present & UNI_IE_ERROR)
491 if(uni_decode_ie_body(UNI_IE_BLLI, (union uni_ieall *)&out->blli, msg, ielen, cx))
498 out->connid.h = *hdr;
499 if (hdr->present & UNI_IE_ERROR)
501 if(uni_decode_ie_body(UNI_IE_CONNID, (union uni_ieall *)&out->connid, msg, ielen, cx))
507 if (hdr->present & UNI_IE_ERROR)
509 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
514 out->notify.h = *hdr;
515 if (hdr->present & UNI_IE_ERROR)
517 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
522 out->conned.h = *hdr;
523 if (hdr->present & UNI_IE_ERROR)
525 if(uni_decode_ie_body(UNI_IE_CONNED, (union uni_ieall *)&out->conned, msg, ielen, cx))
529 case UNI_IE_CONNEDSUB:
530 out->connedsub.h = *hdr;
531 if (hdr->present & UNI_IE_ERROR)
533 if(uni_decode_ie_body(UNI_IE_CONNEDSUB, (union uni_ieall *)&out->connedsub, msg, ielen, cx))
539 if (hdr->present & UNI_IE_ERROR)
541 if(uni_decode_ie_body(UNI_IE_EETD, (union uni_ieall *)&out->eetd, msg, ielen, cx))
546 for(i = 0; i < UNI_NUM_IE_GIT; i++)
547 if (!IE_ISPRESENT(out->git[i])) {
548 out->git[i].h = *hdr;
549 if (hdr->present & UNI_IE_ERROR)
551 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
561 if (hdr->present & UNI_IE_ERROR)
563 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
568 out->traffic.h = *hdr;
569 if (hdr->present & UNI_IE_ERROR)
571 if(uni_decode_ie_body(UNI_IE_TRAFFIC, (union uni_ieall *)&out->traffic, msg, ielen, cx))
577 if (hdr->present & UNI_IE_ERROR)
579 if(uni_decode_ie_body(UNI_IE_EXQOS, (union uni_ieall *)&out->exqos, msg, ielen, cx))
583 case UNI_IE_FACILITY:
586 out->facility.h = *hdr;
587 if (hdr->present & UNI_IE_ERROR)
589 if(uni_decode_ie_body(UNI_IE_FACILITY, (union uni_ieall *)&out->facility, msg, ielen, cx))
593 case UNI_IE_ABRSETUP:
594 out->abrsetup.h = *hdr;
595 if (hdr->present & UNI_IE_ERROR)
597 if(uni_decode_ie_body(UNI_IE_ABRSETUP, (union uni_ieall *)&out->abrsetup, msg, ielen, cx))
602 out->abradd.h = *hdr;
603 if (hdr->present & UNI_IE_ERROR)
605 if(uni_decode_ie_body(UNI_IE_ABRADD, (union uni_ieall *)&out->abradd, msg, ielen, cx))
609 case UNI_IE_CALLED_SOFT:
612 out->called_soft.h = *hdr;
613 if (hdr->present & UNI_IE_ERROR)
615 if(uni_decode_ie_body(UNI_IE_CALLED_SOFT, (union uni_ieall *)&out->called_soft, msg, ielen, cx))
622 out->report.h = *hdr;
623 if (hdr->present & UNI_IE_ERROR)
625 if(uni_decode_ie_body(UNI_IE_REPORT, (union uni_ieall *)&out->report, msg, ielen, cx))
631 if (hdr->present & UNI_IE_ERROR)
633 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
643 static const struct msgdecl decl_connect = {
646 (uni_msg_print_f)print_connect,
647 (uni_msg_check_f)check_connect,
648 (uni_msg_encode_f)encode_connect,
649 (uni_msg_decode_f)decode_connect
653 print_connect_ack(struct uni_connect_ack *msg, struct unicx *cx)
655 if(msg->notify.h.present & UNI_IE_PRESENT)
656 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
657 if(msg->unrec.h.present & UNI_IE_PRESENT)
658 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
662 check_connect_ack(struct uni_connect_ack *m, struct unicx *cx)
666 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
667 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
673 encode_connect_ack(struct uni_msg *msg, struct uni_connect_ack *p, struct unicx *cx)
677 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_CONNECT_ACK, cx, &mlen))
680 if((p->notify.h.present & UNI_IE_PRESENT) &&
681 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
682 return (UNI_IE_NOTIFY);
683 if((p->unrec.h.present & UNI_IE_PRESENT) &&
684 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
685 return (UNI_IE_UNREC);
687 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
688 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
694 decode_connect_ack(struct uni_connect_ack *out, struct uni_msg *msg,
695 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
701 out->notify.h = *hdr;
702 if (hdr->present & UNI_IE_ERROR)
704 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
710 if (hdr->present & UNI_IE_ERROR)
712 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
722 static const struct msgdecl decl_connect_ack = {
725 (uni_msg_print_f)print_connect_ack,
726 (uni_msg_check_f)check_connect_ack,
727 (uni_msg_encode_f)encode_connect_ack,
728 (uni_msg_decode_f)decode_connect_ack
732 print_release(struct uni_release *msg, struct unicx *cx)
736 for(i = 0; i < 2; i++)
737 if(msg->cause[i].h.present & UNI_IE_PRESENT)
738 uni_print_ie_internal(UNI_IE_CAUSE, (union uni_ieall *)&msg->cause[i], cx);
739 if(msg->notify.h.present & UNI_IE_PRESENT)
740 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
741 for(i = 0; i < UNI_NUM_IE_GIT; i++)
742 if(msg->git[i].h.present & UNI_IE_PRESENT)
743 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
744 if(msg->uu.h.present & UNI_IE_PRESENT)
745 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
746 if(msg->facility.h.present & UNI_IE_PRESENT)
747 uni_print_ie_internal(UNI_IE_FACILITY, (union uni_ieall *)&msg->facility, cx);
748 if(msg->crankback.h.present & UNI_IE_PRESENT)
749 uni_print_ie_internal(UNI_IE_CRANKBACK, (union uni_ieall *)&msg->crankback, cx);
750 if(msg->unrec.h.present & UNI_IE_PRESENT)
751 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
755 check_release(struct uni_release *m, struct unicx *cx)
760 for(i = 0; i < 2 ; i++) {
761 ret |= uni_check_ie(UNI_IE_CAUSE, (union uni_ieall *)&m->cause[i], cx);
763 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
764 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
765 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
768 ret |= IE_ISPRESENT(m->uu);
770 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
772 ret |= IE_ISPRESENT(m->facility);
774 ret |= uni_check_ie(UNI_IE_FACILITY, (union uni_ieall *)&m->facility, cx);
776 ret |= IE_ISPRESENT(m->crankback);
778 ret |= uni_check_ie(UNI_IE_CRANKBACK, (union uni_ieall *)&m->crankback, cx);
779 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
785 encode_release(struct uni_msg *msg, struct uni_release *p, struct unicx *cx)
790 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_RELEASE, cx, &mlen))
793 for(i = 0; i < 2; i++)
794 if((p->cause[i].h.present & UNI_IE_PRESENT) &&
795 uni_encode_ie(UNI_IE_CAUSE, msg, (union uni_ieall *)&p->cause[i], cx))
796 return ((i << 16) + UNI_IE_CAUSE);
797 if((p->notify.h.present & UNI_IE_PRESENT) &&
798 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
799 return (UNI_IE_NOTIFY);
800 for(i = 0; i < UNI_NUM_IE_GIT; i++)
801 if((p->git[i].h.present & UNI_IE_PRESENT) &&
802 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
803 return ((i << 16) + UNI_IE_GIT);
804 if((p->uu.h.present & UNI_IE_PRESENT) &&
805 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
807 if((p->facility.h.present & UNI_IE_PRESENT) &&
808 uni_encode_ie(UNI_IE_FACILITY, msg, (union uni_ieall *)&p->facility, cx))
809 return (UNI_IE_FACILITY);
810 if((p->crankback.h.present & UNI_IE_PRESENT) &&
811 uni_encode_ie(UNI_IE_CRANKBACK, msg, (union uni_ieall *)&p->crankback, cx))
812 return (UNI_IE_CRANKBACK);
813 if((p->unrec.h.present & UNI_IE_PRESENT) &&
814 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
815 return (UNI_IE_UNREC);
817 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
818 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
824 decode_release(struct uni_release *out, struct uni_msg *msg,
825 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
833 for(i = 0; i < 2; i++)
834 if (!IE_ISPRESENT(out->cause[i])) {
835 out->cause[i].h = *hdr;
836 if (hdr->present & UNI_IE_ERROR)
838 if(uni_decode_ie_body(UNI_IE_CAUSE, (union uni_ieall *)&out->cause[i], msg, ielen, cx))
845 out->notify.h = *hdr;
846 if (hdr->present & UNI_IE_ERROR)
848 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
853 for(i = 0; i < UNI_NUM_IE_GIT; i++)
854 if (!IE_ISPRESENT(out->git[i])) {
855 out->git[i].h = *hdr;
856 if (hdr->present & UNI_IE_ERROR)
858 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
868 if (hdr->present & UNI_IE_ERROR)
870 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
874 case UNI_IE_FACILITY:
877 out->facility.h = *hdr;
878 if (hdr->present & UNI_IE_ERROR)
880 if(uni_decode_ie_body(UNI_IE_FACILITY, (union uni_ieall *)&out->facility, msg, ielen, cx))
884 case UNI_IE_CRANKBACK:
887 out->crankback.h = *hdr;
888 if (hdr->present & UNI_IE_ERROR)
890 if(uni_decode_ie_body(UNI_IE_CRANKBACK, (union uni_ieall *)&out->crankback, msg, ielen, cx))
896 if (hdr->present & UNI_IE_ERROR)
898 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
908 static const struct msgdecl decl_release = {
911 (uni_msg_print_f)print_release,
912 (uni_msg_check_f)check_release,
913 (uni_msg_encode_f)encode_release,
914 (uni_msg_decode_f)decode_release
918 print_release_compl(struct uni_release_compl *msg, struct unicx *cx)
922 for(i = 0; i < 2; i++)
923 if(msg->cause[i].h.present & UNI_IE_PRESENT)
924 uni_print_ie_internal(UNI_IE_CAUSE, (union uni_ieall *)&msg->cause[i], cx);
925 for(i = 0; i < UNI_NUM_IE_GIT; i++)
926 if(msg->git[i].h.present & UNI_IE_PRESENT)
927 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
928 if(msg->uu.h.present & UNI_IE_PRESENT)
929 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
930 if(msg->crankback.h.present & UNI_IE_PRESENT)
931 uni_print_ie_internal(UNI_IE_CRANKBACK, (union uni_ieall *)&msg->crankback, cx);
932 if(msg->unrec.h.present & UNI_IE_PRESENT)
933 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
937 check_release_compl(struct uni_release_compl *m, struct unicx *cx)
942 for(i = 0; i < 2 ; i++) {
943 ret |= uni_check_ie(UNI_IE_CAUSE, (union uni_ieall *)&m->cause[i], cx);
945 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
947 ret |= IE_ISPRESENT(m->git[i]);
949 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
952 ret |= IE_ISPRESENT(m->uu);
954 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
956 ret |= IE_ISPRESENT(m->crankback);
958 ret |= uni_check_ie(UNI_IE_CRANKBACK, (union uni_ieall *)&m->crankback, cx);
959 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
965 encode_release_compl(struct uni_msg *msg, struct uni_release_compl *p, struct unicx *cx)
970 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_RELEASE_COMPL, cx, &mlen))
973 for(i = 0; i < 2; i++)
974 if((p->cause[i].h.present & UNI_IE_PRESENT) &&
975 uni_encode_ie(UNI_IE_CAUSE, msg, (union uni_ieall *)&p->cause[i], cx))
976 return ((i << 16) + UNI_IE_CAUSE);
977 for(i = 0; i < UNI_NUM_IE_GIT; i++)
978 if((p->git[i].h.present & UNI_IE_PRESENT) &&
979 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
980 return ((i << 16) + UNI_IE_GIT);
981 if((p->uu.h.present & UNI_IE_PRESENT) &&
982 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
984 if((p->crankback.h.present & UNI_IE_PRESENT) &&
985 uni_encode_ie(UNI_IE_CRANKBACK, msg, (union uni_ieall *)&p->crankback, cx))
986 return (UNI_IE_CRANKBACK);
987 if((p->unrec.h.present & UNI_IE_PRESENT) &&
988 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
989 return (UNI_IE_UNREC);
991 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
992 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
998 decode_release_compl(struct uni_release_compl *out, struct uni_msg *msg,
999 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
1007 for(i = 0; i < 2; i++)
1008 if (!IE_ISPRESENT(out->cause[i])) {
1009 out->cause[i].h = *hdr;
1010 if (hdr->present & UNI_IE_ERROR)
1012 if(uni_decode_ie_body(UNI_IE_CAUSE, (union uni_ieall *)&out->cause[i], msg, ielen, cx))
1021 for(i = 0; i < UNI_NUM_IE_GIT; i++)
1022 if (!IE_ISPRESENT(out->git[i])) {
1023 out->git[i].h = *hdr;
1024 if (hdr->present & UNI_IE_ERROR)
1026 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
1036 if (hdr->present & UNI_IE_ERROR)
1038 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
1042 case UNI_IE_CRANKBACK:
1045 out->crankback.h = *hdr;
1046 if (hdr->present & UNI_IE_ERROR)
1048 if(uni_decode_ie_body(UNI_IE_CRANKBACK, (union uni_ieall *)&out->crankback, msg, ielen, cx))
1053 out->unrec.h = *hdr;
1054 if (hdr->present & UNI_IE_ERROR)
1056 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
1066 static const struct msgdecl decl_release_compl = {
1069 (uni_msg_print_f)print_release_compl,
1070 (uni_msg_check_f)check_release_compl,
1071 (uni_msg_encode_f)encode_release_compl,
1072 (uni_msg_decode_f)decode_release_compl
1076 print_setup(struct uni_setup *msg, struct unicx *cx)
1080 if(msg->aal.h.present & UNI_IE_PRESENT)
1081 uni_print_ie_internal(UNI_IE_AAL, (union uni_ieall *)&msg->aal, cx);
1082 if(msg->traffic.h.present & UNI_IE_PRESENT)
1083 uni_print_ie_internal(UNI_IE_TRAFFIC, (union uni_ieall *)&msg->traffic, cx);
1084 if(msg->bearer.h.present & UNI_IE_PRESENT)
1085 uni_print_ie_internal(UNI_IE_BEARER, (union uni_ieall *)&msg->bearer, cx);
1086 if(msg->bhli.h.present & UNI_IE_PRESENT)
1087 uni_print_ie_internal(UNI_IE_BHLI, (union uni_ieall *)&msg->bhli, cx);
1088 if(msg->blli_repeat.h.present & UNI_IE_PRESENT)
1089 uni_print_ie_internal(UNI_IE_REPEAT, (union uni_ieall *)&msg->blli_repeat, cx);
1090 for(i = 0; i < UNI_NUM_IE_BLLI; i++)
1091 if(msg->blli[i].h.present & UNI_IE_PRESENT)
1092 uni_print_ie_internal(UNI_IE_BLLI, (union uni_ieall *)&msg->blli[i], cx);
1093 if(msg->called.h.present & UNI_IE_PRESENT)
1094 uni_print_ie_internal(UNI_IE_CALLED, (union uni_ieall *)&msg->called, cx);
1095 for(i = 0; i < UNI_NUM_IE_CALLEDSUB; i++)
1096 if(msg->calledsub[i].h.present & UNI_IE_PRESENT)
1097 uni_print_ie_internal(UNI_IE_CALLEDSUB, (union uni_ieall *)&msg->calledsub[i], cx);
1098 if(msg->calling.h.present & UNI_IE_PRESENT)
1099 uni_print_ie_internal(UNI_IE_CALLING, (union uni_ieall *)&msg->calling, cx);
1100 for(i = 0; i < UNI_NUM_IE_CALLINGSUB; i++)
1101 if(msg->callingsub[i].h.present & UNI_IE_PRESENT)
1102 uni_print_ie_internal(UNI_IE_CALLINGSUB, (union uni_ieall *)&msg->callingsub[i], cx);
1103 if(msg->connid.h.present & UNI_IE_PRESENT)
1104 uni_print_ie_internal(UNI_IE_CONNID, (union uni_ieall *)&msg->connid, cx);
1105 if(msg->qos.h.present & UNI_IE_PRESENT)
1106 uni_print_ie_internal(UNI_IE_QOS, (union uni_ieall *)&msg->qos, cx);
1107 if(msg->eetd.h.present & UNI_IE_PRESENT)
1108 uni_print_ie_internal(UNI_IE_EETD, (union uni_ieall *)&msg->eetd, cx);
1109 if(msg->notify.h.present & UNI_IE_PRESENT)
1110 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
1111 if(msg->scompl.h.present & UNI_IE_PRESENT)
1112 uni_print_ie_internal(UNI_IE_SCOMPL, (union uni_ieall *)&msg->scompl, cx);
1113 for(i = 0; i < UNI_NUM_IE_TNS; i++)
1114 if(msg->tns[i].h.present & UNI_IE_PRESENT)
1115 uni_print_ie_internal(UNI_IE_TNS, (union uni_ieall *)&msg->tns[i], cx);
1116 if(msg->epref.h.present & UNI_IE_PRESENT)
1117 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
1118 if(msg->atraffic.h.present & UNI_IE_PRESENT)
1119 uni_print_ie_internal(UNI_IE_ATRAFFIC, (union uni_ieall *)&msg->atraffic, cx);
1120 if(msg->mintraffic.h.present & UNI_IE_PRESENT)
1121 uni_print_ie_internal(UNI_IE_MINTRAFFIC, (union uni_ieall *)&msg->mintraffic, cx);
1122 if(msg->uu.h.present & UNI_IE_PRESENT)
1123 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
1124 for(i = 0; i < UNI_NUM_IE_GIT; i++)
1125 if(msg->git[i].h.present & UNI_IE_PRESENT)
1126 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
1127 if(msg->lij_callid.h.present & UNI_IE_PRESENT)
1128 uni_print_ie_internal(UNI_IE_LIJ_CALLID, (union uni_ieall *)&msg->lij_callid, cx);
1129 if(msg->lij_param.h.present & UNI_IE_PRESENT)
1130 uni_print_ie_internal(UNI_IE_LIJ_PARAM, (union uni_ieall *)&msg->lij_param, cx);
1131 if(msg->lij_seqno.h.present & UNI_IE_PRESENT)
1132 uni_print_ie_internal(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&msg->lij_seqno, cx);
1133 if(msg->exqos.h.present & UNI_IE_PRESENT)
1134 uni_print_ie_internal(UNI_IE_EXQOS, (union uni_ieall *)&msg->exqos, cx);
1135 if(msg->abrsetup.h.present & UNI_IE_PRESENT)
1136 uni_print_ie_internal(UNI_IE_ABRSETUP, (union uni_ieall *)&msg->abrsetup, cx);
1137 if(msg->abradd.h.present & UNI_IE_PRESENT)
1138 uni_print_ie_internal(UNI_IE_ABRADD, (union uni_ieall *)&msg->abradd, cx);
1139 if(msg->cscope.h.present & UNI_IE_PRESENT)
1140 uni_print_ie_internal(UNI_IE_CSCOPE, (union uni_ieall *)&msg->cscope, cx);
1141 if(msg->calling_soft.h.present & UNI_IE_PRESENT)
1142 uni_print_ie_internal(UNI_IE_CALLING_SOFT, (union uni_ieall *)&msg->calling_soft, cx);
1143 if(msg->called_soft.h.present & UNI_IE_PRESENT)
1144 uni_print_ie_internal(UNI_IE_CALLED_SOFT, (union uni_ieall *)&msg->called_soft, cx);
1145 if(msg->dtl_repeat.h.present & UNI_IE_PRESENT)
1146 uni_print_ie_internal(UNI_IE_REPEAT, (union uni_ieall *)&msg->dtl_repeat, cx);
1147 for(i = 0; i < UNI_NUM_IE_DTL; i++)
1148 if(msg->dtl[i].h.present & UNI_IE_PRESENT)
1149 uni_print_ie_internal(UNI_IE_DTL, (union uni_ieall *)&msg->dtl[i], cx);
1150 if(msg->report.h.present & UNI_IE_PRESENT)
1151 uni_print_ie_internal(UNI_IE_REPORT, (union uni_ieall *)&msg->report, cx);
1152 if(msg->mdcr.h.present & UNI_IE_PRESENT)
1153 uni_print_ie_internal(UNI_IE_MDCR, (union uni_ieall *)&msg->mdcr, cx);
1154 if(msg->unrec.h.present & UNI_IE_PRESENT)
1155 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
1159 check_setup(struct uni_setup *m, struct unicx *cx)
1164 ret |= uni_check_ie(UNI_IE_AAL, (union uni_ieall *)&m->aal, cx);
1165 ret |= uni_check_ie(UNI_IE_TRAFFIC, (union uni_ieall *)&m->traffic, cx);
1166 ret |= uni_check_ie(UNI_IE_BEARER, (union uni_ieall *)&m->bearer, cx);
1167 ret |= uni_check_ie(UNI_IE_BHLI, (union uni_ieall *)&m->bhli, cx);
1168 ret |= uni_check_ie(UNI_IE_REPEAT, (union uni_ieall *)&m->blli_repeat, cx);
1169 for(i = 0; i < UNI_NUM_IE_BLLI ; i++) {
1170 ret |= uni_check_ie(UNI_IE_BLLI, (union uni_ieall *)&m->blli[i], cx);
1172 ret |= uni_check_ie(UNI_IE_CALLED, (union uni_ieall *)&m->called, cx);
1173 for(i = 0; i < UNI_NUM_IE_CALLEDSUB ; i++) {
1174 ret |= uni_check_ie(UNI_IE_CALLEDSUB, (union uni_ieall *)&m->calledsub[i], cx);
1176 ret |= uni_check_ie(UNI_IE_CALLING, (union uni_ieall *)&m->calling, cx);
1177 for(i = 0; i < UNI_NUM_IE_CALLINGSUB ; i++) {
1178 ret |= uni_check_ie(UNI_IE_CALLINGSUB, (union uni_ieall *)&m->callingsub[i], cx);
1180 ret |= uni_check_ie(UNI_IE_CONNID, (union uni_ieall *)&m->connid, cx);
1181 ret |= uni_check_ie(UNI_IE_QOS, (union uni_ieall *)&m->qos, cx);
1182 ret |= uni_check_ie(UNI_IE_EETD, (union uni_ieall *)&m->eetd, cx);
1183 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
1185 ret |= IE_ISPRESENT(m->scompl);
1187 ret |= uni_check_ie(UNI_IE_SCOMPL, (union uni_ieall *)&m->scompl, cx);
1188 for(i = 0; i < UNI_NUM_IE_TNS ; i++) {
1189 ret |= uni_check_ie(UNI_IE_TNS, (union uni_ieall *)&m->tns[i], cx);
1191 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
1192 ret |= uni_check_ie(UNI_IE_ATRAFFIC, (union uni_ieall *)&m->atraffic, cx);
1193 ret |= uni_check_ie(UNI_IE_MINTRAFFIC, (union uni_ieall *)&m->mintraffic, cx);
1195 ret |= IE_ISPRESENT(m->uu);
1197 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
1198 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
1199 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
1202 ret |= IE_ISPRESENT(m->lij_callid);
1204 ret |= uni_check_ie(UNI_IE_LIJ_CALLID, (union uni_ieall *)&m->lij_callid, cx);
1206 ret |= IE_ISPRESENT(m->lij_param);
1208 ret |= uni_check_ie(UNI_IE_LIJ_PARAM, (union uni_ieall *)&m->lij_param, cx);
1210 ret |= IE_ISPRESENT(m->lij_seqno);
1212 ret |= uni_check_ie(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&m->lij_seqno, cx);
1213 ret |= uni_check_ie(UNI_IE_EXQOS, (union uni_ieall *)&m->exqos, cx);
1214 ret |= uni_check_ie(UNI_IE_ABRSETUP, (union uni_ieall *)&m->abrsetup, cx);
1215 ret |= uni_check_ie(UNI_IE_ABRADD, (union uni_ieall *)&m->abradd, cx);
1216 ret |= uni_check_ie(UNI_IE_CSCOPE, (union uni_ieall *)&m->cscope, cx);
1218 ret |= IE_ISPRESENT(m->calling_soft);
1220 ret |= uni_check_ie(UNI_IE_CALLING_SOFT, (union uni_ieall *)&m->calling_soft, cx);
1222 ret |= IE_ISPRESENT(m->called_soft);
1224 ret |= uni_check_ie(UNI_IE_CALLED_SOFT, (union uni_ieall *)&m->called_soft, cx);
1226 ret |= IE_ISPRESENT(m->dtl_repeat);
1228 ret |= uni_check_ie(UNI_IE_REPEAT, (union uni_ieall *)&m->dtl_repeat, cx);
1229 for(i = 0; i < UNI_NUM_IE_DTL ; i++) {
1231 ret |= IE_ISPRESENT(m->dtl[i]);
1233 ret |= uni_check_ie(UNI_IE_DTL, (union uni_ieall *)&m->dtl[i], cx);
1236 ret |= IE_ISPRESENT(m->report);
1238 ret |= uni_check_ie(UNI_IE_REPORT, (union uni_ieall *)&m->report, cx);
1239 ret |= uni_check_ie(UNI_IE_MDCR, (union uni_ieall *)&m->mdcr, cx);
1240 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
1246 encode_setup(struct uni_msg *msg, struct uni_setup *p, struct unicx *cx)
1251 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_SETUP, cx, &mlen))
1254 if((p->aal.h.present & UNI_IE_PRESENT) &&
1255 uni_encode_ie(UNI_IE_AAL, msg, (union uni_ieall *)&p->aal, cx))
1256 return (UNI_IE_AAL);
1257 if((p->traffic.h.present & UNI_IE_PRESENT) &&
1258 uni_encode_ie(UNI_IE_TRAFFIC, msg, (union uni_ieall *)&p->traffic, cx))
1259 return (UNI_IE_TRAFFIC);
1260 if((p->bearer.h.present & UNI_IE_PRESENT) &&
1261 uni_encode_ie(UNI_IE_BEARER, msg, (union uni_ieall *)&p->bearer, cx))
1262 return (UNI_IE_BEARER);
1263 if((p->bhli.h.present & UNI_IE_PRESENT) &&
1264 uni_encode_ie(UNI_IE_BHLI, msg, (union uni_ieall *)&p->bhli, cx))
1265 return (UNI_IE_BHLI);
1266 if((p->blli_repeat.h.present & UNI_IE_PRESENT) &&
1267 uni_encode_ie(UNI_IE_BLLI, msg, (union uni_ieall *)&p->blli_repeat, cx))
1268 return (0x10000000 + UNI_IE_BLLI);
1269 for(i = 0; i < UNI_NUM_IE_BLLI; i++)
1270 if((p->blli[i].h.present & UNI_IE_PRESENT) &&
1271 uni_encode_ie(UNI_IE_BLLI, msg, (union uni_ieall *)&p->blli[i], cx))
1272 return ((i << 16) + UNI_IE_BLLI);
1273 if((p->called.h.present & UNI_IE_PRESENT) &&
1274 uni_encode_ie(UNI_IE_CALLED, msg, (union uni_ieall *)&p->called, cx))
1275 return (UNI_IE_CALLED);
1276 for(i = 0; i < UNI_NUM_IE_CALLEDSUB; i++)
1277 if((p->calledsub[i].h.present & UNI_IE_PRESENT) &&
1278 uni_encode_ie(UNI_IE_CALLEDSUB, msg, (union uni_ieall *)&p->calledsub[i], cx))
1279 return ((i << 16) + UNI_IE_CALLEDSUB);
1280 if((p->calling.h.present & UNI_IE_PRESENT) &&
1281 uni_encode_ie(UNI_IE_CALLING, msg, (union uni_ieall *)&p->calling, cx))
1282 return (UNI_IE_CALLING);
1283 for(i = 0; i < UNI_NUM_IE_CALLINGSUB; i++)
1284 if((p->callingsub[i].h.present & UNI_IE_PRESENT) &&
1285 uni_encode_ie(UNI_IE_CALLINGSUB, msg, (union uni_ieall *)&p->callingsub[i], cx))
1286 return ((i << 16) + UNI_IE_CALLINGSUB);
1287 if((p->connid.h.present & UNI_IE_PRESENT) &&
1288 uni_encode_ie(UNI_IE_CONNID, msg, (union uni_ieall *)&p->connid, cx))
1289 return (UNI_IE_CONNID);
1290 if((p->qos.h.present & UNI_IE_PRESENT) &&
1291 uni_encode_ie(UNI_IE_QOS, msg, (union uni_ieall *)&p->qos, cx))
1292 return (UNI_IE_QOS);
1293 if((p->eetd.h.present & UNI_IE_PRESENT) &&
1294 uni_encode_ie(UNI_IE_EETD, msg, (union uni_ieall *)&p->eetd, cx))
1295 return (UNI_IE_EETD);
1296 if((p->notify.h.present & UNI_IE_PRESENT) &&
1297 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
1298 return (UNI_IE_NOTIFY);
1299 if((p->scompl.h.present & UNI_IE_PRESENT) &&
1300 uni_encode_ie(UNI_IE_SCOMPL, msg, (union uni_ieall *)&p->scompl, cx))
1301 return (UNI_IE_SCOMPL);
1302 for(i = 0; i < UNI_NUM_IE_TNS; i++)
1303 if((p->tns[i].h.present & UNI_IE_PRESENT) &&
1304 uni_encode_ie(UNI_IE_TNS, msg, (union uni_ieall *)&p->tns[i], cx))
1305 return ((i << 16) + UNI_IE_TNS);
1306 if((p->epref.h.present & UNI_IE_PRESENT) &&
1307 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
1308 return (UNI_IE_EPREF);
1309 if((p->atraffic.h.present & UNI_IE_PRESENT) &&
1310 uni_encode_ie(UNI_IE_ATRAFFIC, msg, (union uni_ieall *)&p->atraffic, cx))
1311 return (UNI_IE_ATRAFFIC);
1312 if((p->mintraffic.h.present & UNI_IE_PRESENT) &&
1313 uni_encode_ie(UNI_IE_MINTRAFFIC, msg, (union uni_ieall *)&p->mintraffic, cx))
1314 return (UNI_IE_MINTRAFFIC);
1315 if((p->uu.h.present & UNI_IE_PRESENT) &&
1316 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
1318 for(i = 0; i < UNI_NUM_IE_GIT; i++)
1319 if((p->git[i].h.present & UNI_IE_PRESENT) &&
1320 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
1321 return ((i << 16) + UNI_IE_GIT);
1322 if((p->lij_callid.h.present & UNI_IE_PRESENT) &&
1323 uni_encode_ie(UNI_IE_LIJ_CALLID, msg, (union uni_ieall *)&p->lij_callid, cx))
1324 return (UNI_IE_LIJ_CALLID);
1325 if((p->lij_param.h.present & UNI_IE_PRESENT) &&
1326 uni_encode_ie(UNI_IE_LIJ_PARAM, msg, (union uni_ieall *)&p->lij_param, cx))
1327 return (UNI_IE_LIJ_PARAM);
1328 if((p->lij_seqno.h.present & UNI_IE_PRESENT) &&
1329 uni_encode_ie(UNI_IE_LIJ_SEQNO, msg, (union uni_ieall *)&p->lij_seqno, cx))
1330 return (UNI_IE_LIJ_SEQNO);
1331 if((p->exqos.h.present & UNI_IE_PRESENT) &&
1332 uni_encode_ie(UNI_IE_EXQOS, msg, (union uni_ieall *)&p->exqos, cx))
1333 return (UNI_IE_EXQOS);
1334 if((p->abrsetup.h.present & UNI_IE_PRESENT) &&
1335 uni_encode_ie(UNI_IE_ABRSETUP, msg, (union uni_ieall *)&p->abrsetup, cx))
1336 return (UNI_IE_ABRSETUP);
1337 if((p->abradd.h.present & UNI_IE_PRESENT) &&
1338 uni_encode_ie(UNI_IE_ABRADD, msg, (union uni_ieall *)&p->abradd, cx))
1339 return (UNI_IE_ABRADD);
1340 if((p->cscope.h.present & UNI_IE_PRESENT) &&
1341 uni_encode_ie(UNI_IE_CSCOPE, msg, (union uni_ieall *)&p->cscope, cx))
1342 return (UNI_IE_CSCOPE);
1343 if((p->calling_soft.h.present & UNI_IE_PRESENT) &&
1344 uni_encode_ie(UNI_IE_CALLING_SOFT, msg, (union uni_ieall *)&p->calling_soft, cx))
1345 return (UNI_IE_CALLING_SOFT);
1346 if((p->called_soft.h.present & UNI_IE_PRESENT) &&
1347 uni_encode_ie(UNI_IE_CALLED_SOFT, msg, (union uni_ieall *)&p->called_soft, cx))
1348 return (UNI_IE_CALLED_SOFT);
1349 if((p->dtl_repeat.h.present & UNI_IE_PRESENT) &&
1350 uni_encode_ie(UNI_IE_DTL, msg, (union uni_ieall *)&p->dtl_repeat, cx))
1351 return (0x10000000 + UNI_IE_DTL);
1352 for(i = 0; i < UNI_NUM_IE_DTL; i++)
1353 if((p->dtl[i].h.present & UNI_IE_PRESENT) &&
1354 uni_encode_ie(UNI_IE_DTL, msg, (union uni_ieall *)&p->dtl[i], cx))
1355 return ((i << 16) + UNI_IE_DTL);
1356 if((p->report.h.present & UNI_IE_PRESENT) &&
1357 uni_encode_ie(UNI_IE_REPORT, msg, (union uni_ieall *)&p->report, cx))
1358 return (UNI_IE_REPORT);
1359 if((p->mdcr.h.present & UNI_IE_PRESENT) &&
1360 uni_encode_ie(UNI_IE_MDCR, msg, (union uni_ieall *)&p->mdcr, cx))
1361 return (UNI_IE_MDCR);
1362 if((p->unrec.h.present & UNI_IE_PRESENT) &&
1363 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
1364 return (UNI_IE_UNREC);
1366 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
1367 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
1373 decode_setup(struct uni_setup *out, struct uni_msg *msg,
1374 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
1383 if (hdr->present & UNI_IE_ERROR)
1385 if(uni_decode_ie_body(UNI_IE_AAL, (union uni_ieall *)&out->aal, msg, ielen, cx))
1389 case UNI_IE_TRAFFIC:
1390 out->traffic.h = *hdr;
1391 if (hdr->present & UNI_IE_ERROR)
1393 if(uni_decode_ie_body(UNI_IE_TRAFFIC, (union uni_ieall *)&out->traffic, msg, ielen, cx))
1398 out->bearer.h = *hdr;
1399 if (hdr->present & UNI_IE_ERROR)
1401 if(uni_decode_ie_body(UNI_IE_BEARER, (union uni_ieall *)&out->bearer, msg, ielen, cx))
1407 if (hdr->present & UNI_IE_ERROR)
1409 if(uni_decode_ie_body(UNI_IE_BHLI, (union uni_ieall *)&out->bhli, msg, ielen, cx))
1414 if (IE_ISPRESENT(cx->repeat))
1415 out->blli_repeat = cx->repeat;
1416 for(i = 0; i < UNI_NUM_IE_BLLI; i++)
1417 if (!IE_ISPRESENT(out->blli[i])) {
1418 out->blli[i].h = *hdr;
1419 if (hdr->present & UNI_IE_ERROR)
1421 if(uni_decode_ie_body(UNI_IE_BLLI, (union uni_ieall *)&out->blli[i], msg, ielen, cx))
1428 out->called.h = *hdr;
1429 if (hdr->present & UNI_IE_ERROR)
1431 if(uni_decode_ie_body(UNI_IE_CALLED, (union uni_ieall *)&out->called, msg, ielen, cx))
1435 case UNI_IE_CALLEDSUB:
1436 for(i = 0; i < UNI_NUM_IE_CALLEDSUB; i++)
1437 if (!IE_ISPRESENT(out->calledsub[i])) {
1438 out->calledsub[i].h = *hdr;
1439 if (hdr->present & UNI_IE_ERROR)
1441 if(uni_decode_ie_body(UNI_IE_CALLEDSUB, (union uni_ieall *)&out->calledsub[i], msg, ielen, cx))
1447 case UNI_IE_CALLING:
1448 out->calling.h = *hdr;
1449 if (hdr->present & UNI_IE_ERROR)
1451 if(uni_decode_ie_body(UNI_IE_CALLING, (union uni_ieall *)&out->calling, msg, ielen, cx))
1455 case UNI_IE_CALLINGSUB:
1456 for(i = 0; i < UNI_NUM_IE_CALLINGSUB; i++)
1457 if (!IE_ISPRESENT(out->callingsub[i])) {
1458 out->callingsub[i].h = *hdr;
1459 if (hdr->present & UNI_IE_ERROR)
1461 if(uni_decode_ie_body(UNI_IE_CALLINGSUB, (union uni_ieall *)&out->callingsub[i], msg, ielen, cx))
1468 out->connid.h = *hdr;
1469 if (hdr->present & UNI_IE_ERROR)
1471 if(uni_decode_ie_body(UNI_IE_CONNID, (union uni_ieall *)&out->connid, msg, ielen, cx))
1477 if (hdr->present & UNI_IE_ERROR)
1479 if(uni_decode_ie_body(UNI_IE_QOS, (union uni_ieall *)&out->qos, msg, ielen, cx))
1485 if (hdr->present & UNI_IE_ERROR)
1487 if(uni_decode_ie_body(UNI_IE_EETD, (union uni_ieall *)&out->eetd, msg, ielen, cx))
1492 out->notify.h = *hdr;
1493 if (hdr->present & UNI_IE_ERROR)
1495 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
1502 out->scompl.h = *hdr;
1503 if (hdr->present & UNI_IE_ERROR)
1505 if(uni_decode_ie_body(UNI_IE_SCOMPL, (union uni_ieall *)&out->scompl, msg, ielen, cx))
1510 for(i = 0; i < UNI_NUM_IE_TNS; i++)
1511 if (!IE_ISPRESENT(out->tns[i])) {
1512 out->tns[i].h = *hdr;
1513 if (hdr->present & UNI_IE_ERROR)
1515 if(uni_decode_ie_body(UNI_IE_TNS, (union uni_ieall *)&out->tns[i], msg, ielen, cx))
1522 out->epref.h = *hdr;
1523 if (hdr->present & UNI_IE_ERROR)
1525 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
1529 case UNI_IE_ATRAFFIC:
1530 out->atraffic.h = *hdr;
1531 if (hdr->present & UNI_IE_ERROR)
1533 if(uni_decode_ie_body(UNI_IE_ATRAFFIC, (union uni_ieall *)&out->atraffic, msg, ielen, cx))
1537 case UNI_IE_MINTRAFFIC:
1538 out->mintraffic.h = *hdr;
1539 if (hdr->present & UNI_IE_ERROR)
1541 if(uni_decode_ie_body(UNI_IE_MINTRAFFIC, (union uni_ieall *)&out->mintraffic, msg, ielen, cx))
1549 if (hdr->present & UNI_IE_ERROR)
1551 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
1556 for(i = 0; i < UNI_NUM_IE_GIT; i++)
1557 if (!IE_ISPRESENT(out->git[i])) {
1558 out->git[i].h = *hdr;
1559 if (hdr->present & UNI_IE_ERROR)
1561 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
1567 case UNI_IE_LIJ_CALLID:
1570 out->lij_callid.h = *hdr;
1571 if (hdr->present & UNI_IE_ERROR)
1573 if(uni_decode_ie_body(UNI_IE_LIJ_CALLID, (union uni_ieall *)&out->lij_callid, msg, ielen, cx))
1577 case UNI_IE_LIJ_PARAM:
1580 out->lij_param.h = *hdr;
1581 if (hdr->present & UNI_IE_ERROR)
1583 if(uni_decode_ie_body(UNI_IE_LIJ_PARAM, (union uni_ieall *)&out->lij_param, msg, ielen, cx))
1587 case UNI_IE_LIJ_SEQNO:
1590 out->lij_seqno.h = *hdr;
1591 if (hdr->present & UNI_IE_ERROR)
1593 if(uni_decode_ie_body(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&out->lij_seqno, msg, ielen, cx))
1598 out->exqos.h = *hdr;
1599 if (hdr->present & UNI_IE_ERROR)
1601 if(uni_decode_ie_body(UNI_IE_EXQOS, (union uni_ieall *)&out->exqos, msg, ielen, cx))
1605 case UNI_IE_ABRSETUP:
1606 out->abrsetup.h = *hdr;
1607 if (hdr->present & UNI_IE_ERROR)
1609 if(uni_decode_ie_body(UNI_IE_ABRSETUP, (union uni_ieall *)&out->abrsetup, msg, ielen, cx))
1614 out->abradd.h = *hdr;
1615 if (hdr->present & UNI_IE_ERROR)
1617 if(uni_decode_ie_body(UNI_IE_ABRADD, (union uni_ieall *)&out->abradd, msg, ielen, cx))
1622 out->cscope.h = *hdr;
1623 if (hdr->present & UNI_IE_ERROR)
1625 if(uni_decode_ie_body(UNI_IE_CSCOPE, (union uni_ieall *)&out->cscope, msg, ielen, cx))
1629 case UNI_IE_CALLING_SOFT:
1632 out->calling_soft.h = *hdr;
1633 if (hdr->present & UNI_IE_ERROR)
1635 if(uni_decode_ie_body(UNI_IE_CALLING_SOFT, (union uni_ieall *)&out->calling_soft, msg, ielen, cx))
1639 case UNI_IE_CALLED_SOFT:
1642 out->called_soft.h = *hdr;
1643 if (hdr->present & UNI_IE_ERROR)
1645 if(uni_decode_ie_body(UNI_IE_CALLED_SOFT, (union uni_ieall *)&out->called_soft, msg, ielen, cx))
1652 if (IE_ISPRESENT(cx->repeat))
1653 out->dtl_repeat = cx->repeat;
1654 for(i = 0; i < UNI_NUM_IE_DTL; i++)
1655 if (!IE_ISPRESENT(out->dtl[i])) {
1656 out->dtl[i].h = *hdr;
1657 if (hdr->present & UNI_IE_ERROR)
1659 if(uni_decode_ie_body(UNI_IE_DTL, (union uni_ieall *)&out->dtl[i], msg, ielen, cx))
1668 out->report.h = *hdr;
1669 if (hdr->present & UNI_IE_ERROR)
1671 if(uni_decode_ie_body(UNI_IE_REPORT, (union uni_ieall *)&out->report, msg, ielen, cx))
1677 if (hdr->present & UNI_IE_ERROR)
1679 if(uni_decode_ie_body(UNI_IE_MDCR, (union uni_ieall *)&out->mdcr, msg, ielen, cx))
1684 out->unrec.h = *hdr;
1685 if (hdr->present & UNI_IE_ERROR)
1687 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
1692 cx->repeat.h = *hdr;
1693 if (hdr->present & UNI_IE_ERROR)
1695 if (uni_decode_ie_body(UNI_IE_REPEAT, (union uni_ieall *)&cx->repeat, msg, ielen, cx))
1705 static const struct msgdecl decl_setup = {
1708 (uni_msg_print_f)print_setup,
1709 (uni_msg_check_f)check_setup,
1710 (uni_msg_encode_f)encode_setup,
1711 (uni_msg_decode_f)decode_setup
1715 print_status(struct uni_status *msg, struct unicx *cx)
1717 if(msg->callstate.h.present & UNI_IE_PRESENT)
1718 uni_print_ie_internal(UNI_IE_CALLSTATE, (union uni_ieall *)&msg->callstate, cx);
1719 if(msg->cause.h.present & UNI_IE_PRESENT)
1720 uni_print_ie_internal(UNI_IE_CAUSE, (union uni_ieall *)&msg->cause, cx);
1721 if(msg->epref.h.present & UNI_IE_PRESENT)
1722 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
1723 if(msg->epstate.h.present & UNI_IE_PRESENT)
1724 uni_print_ie_internal(UNI_IE_EPSTATE, (union uni_ieall *)&msg->epstate, cx);
1725 if(msg->unrec.h.present & UNI_IE_PRESENT)
1726 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
1730 check_status(struct uni_status *m, struct unicx *cx)
1734 ret |= uni_check_ie(UNI_IE_CALLSTATE, (union uni_ieall *)&m->callstate, cx);
1735 ret |= uni_check_ie(UNI_IE_CAUSE, (union uni_ieall *)&m->cause, cx);
1736 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
1737 ret |= uni_check_ie(UNI_IE_EPSTATE, (union uni_ieall *)&m->epstate, cx);
1738 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
1744 encode_status(struct uni_msg *msg, struct uni_status *p, struct unicx *cx)
1748 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_STATUS, cx, &mlen))
1751 if((p->callstate.h.present & UNI_IE_PRESENT) &&
1752 uni_encode_ie(UNI_IE_CALLSTATE, msg, (union uni_ieall *)&p->callstate, cx))
1753 return (UNI_IE_CALLSTATE);
1754 if((p->cause.h.present & UNI_IE_PRESENT) &&
1755 uni_encode_ie(UNI_IE_CAUSE, msg, (union uni_ieall *)&p->cause, cx))
1756 return (UNI_IE_CAUSE);
1757 if((p->epref.h.present & UNI_IE_PRESENT) &&
1758 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
1759 return (UNI_IE_EPREF);
1760 if((p->epstate.h.present & UNI_IE_PRESENT) &&
1761 uni_encode_ie(UNI_IE_EPSTATE, msg, (union uni_ieall *)&p->epstate, cx))
1762 return (UNI_IE_EPSTATE);
1763 if((p->unrec.h.present & UNI_IE_PRESENT) &&
1764 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
1765 return (UNI_IE_UNREC);
1767 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
1768 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
1774 decode_status(struct uni_status *out, struct uni_msg *msg,
1775 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
1780 case UNI_IE_CALLSTATE:
1781 out->callstate.h = *hdr;
1782 if (hdr->present & UNI_IE_ERROR)
1784 if(uni_decode_ie_body(UNI_IE_CALLSTATE, (union uni_ieall *)&out->callstate, msg, ielen, cx))
1789 out->cause.h = *hdr;
1790 if (hdr->present & UNI_IE_ERROR)
1792 if(uni_decode_ie_body(UNI_IE_CAUSE, (union uni_ieall *)&out->cause, msg, ielen, cx))
1797 out->epref.h = *hdr;
1798 if (hdr->present & UNI_IE_ERROR)
1800 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
1804 case UNI_IE_EPSTATE:
1805 out->epstate.h = *hdr;
1806 if (hdr->present & UNI_IE_ERROR)
1808 if(uni_decode_ie_body(UNI_IE_EPSTATE, (union uni_ieall *)&out->epstate, msg, ielen, cx))
1813 out->unrec.h = *hdr;
1814 if (hdr->present & UNI_IE_ERROR)
1816 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
1826 static const struct msgdecl decl_status = {
1829 (uni_msg_print_f)print_status,
1830 (uni_msg_check_f)check_status,
1831 (uni_msg_encode_f)encode_status,
1832 (uni_msg_decode_f)decode_status
1836 print_status_enq(struct uni_status_enq *msg, struct unicx *cx)
1838 if(msg->epref.h.present & UNI_IE_PRESENT)
1839 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
1840 if(msg->unrec.h.present & UNI_IE_PRESENT)
1841 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
1845 check_status_enq(struct uni_status_enq *m, struct unicx *cx)
1849 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
1850 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
1856 encode_status_enq(struct uni_msg *msg, struct uni_status_enq *p, struct unicx *cx)
1860 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_STATUS_ENQ, cx, &mlen))
1863 if((p->epref.h.present & UNI_IE_PRESENT) &&
1864 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
1865 return (UNI_IE_EPREF);
1866 if((p->unrec.h.present & UNI_IE_PRESENT) &&
1867 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
1868 return (UNI_IE_UNREC);
1870 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
1871 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
1877 decode_status_enq(struct uni_status_enq *out, struct uni_msg *msg,
1878 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
1884 out->epref.h = *hdr;
1885 if (hdr->present & UNI_IE_ERROR)
1887 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
1892 out->unrec.h = *hdr;
1893 if (hdr->present & UNI_IE_ERROR)
1895 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
1905 static const struct msgdecl decl_status_enq = {
1908 (uni_msg_print_f)print_status_enq,
1909 (uni_msg_check_f)check_status_enq,
1910 (uni_msg_encode_f)encode_status_enq,
1911 (uni_msg_decode_f)decode_status_enq
1915 print_notify(struct uni_notify *msg, struct unicx *cx)
1917 if(msg->notify.h.present & UNI_IE_PRESENT)
1918 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
1919 if(msg->epref.h.present & UNI_IE_PRESENT)
1920 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
1921 if(msg->unrec.h.present & UNI_IE_PRESENT)
1922 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
1926 check_notify(struct uni_notify *m, struct unicx *cx)
1930 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
1931 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
1932 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
1938 encode_notify(struct uni_msg *msg, struct uni_notify *p, struct unicx *cx)
1942 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_NOTIFY, cx, &mlen))
1945 if((p->notify.h.present & UNI_IE_PRESENT) &&
1946 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
1947 return (UNI_IE_NOTIFY);
1948 if((p->epref.h.present & UNI_IE_PRESENT) &&
1949 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
1950 return (UNI_IE_EPREF);
1951 if((p->unrec.h.present & UNI_IE_PRESENT) &&
1952 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
1953 return (UNI_IE_UNREC);
1955 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
1956 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
1962 decode_notify(struct uni_notify *out, struct uni_msg *msg,
1963 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
1969 out->notify.h = *hdr;
1970 if (hdr->present & UNI_IE_ERROR)
1972 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
1977 out->epref.h = *hdr;
1978 if (hdr->present & UNI_IE_ERROR)
1980 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
1985 out->unrec.h = *hdr;
1986 if (hdr->present & UNI_IE_ERROR)
1988 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
1998 static const struct msgdecl decl_notify = {
2001 (uni_msg_print_f)print_notify,
2002 (uni_msg_check_f)check_notify,
2003 (uni_msg_encode_f)encode_notify,
2004 (uni_msg_decode_f)decode_notify
2008 print_restart(struct uni_restart *msg, struct unicx *cx)
2010 if(msg->connid.h.present & UNI_IE_PRESENT)
2011 uni_print_ie_internal(UNI_IE_CONNID, (union uni_ieall *)&msg->connid, cx);
2012 if(msg->restart.h.present & UNI_IE_PRESENT)
2013 uni_print_ie_internal(UNI_IE_RESTART, (union uni_ieall *)&msg->restart, cx);
2014 if(msg->unrec.h.present & UNI_IE_PRESENT)
2015 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
2019 check_restart(struct uni_restart *m, struct unicx *cx)
2023 ret |= uni_check_ie(UNI_IE_CONNID, (union uni_ieall *)&m->connid, cx);
2024 ret |= uni_check_ie(UNI_IE_RESTART, (union uni_ieall *)&m->restart, cx);
2025 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
2031 encode_restart(struct uni_msg *msg, struct uni_restart *p, struct unicx *cx)
2035 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_RESTART, cx, &mlen))
2038 if((p->connid.h.present & UNI_IE_PRESENT) &&
2039 uni_encode_ie(UNI_IE_CONNID, msg, (union uni_ieall *)&p->connid, cx))
2040 return (UNI_IE_CONNID);
2041 if((p->restart.h.present & UNI_IE_PRESENT) &&
2042 uni_encode_ie(UNI_IE_RESTART, msg, (union uni_ieall *)&p->restart, cx))
2043 return (UNI_IE_RESTART);
2044 if((p->unrec.h.present & UNI_IE_PRESENT) &&
2045 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
2046 return (UNI_IE_UNREC);
2048 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
2049 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
2055 decode_restart(struct uni_restart *out, struct uni_msg *msg,
2056 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
2062 out->connid.h = *hdr;
2063 if (hdr->present & UNI_IE_ERROR)
2065 if(uni_decode_ie_body(UNI_IE_CONNID, (union uni_ieall *)&out->connid, msg, ielen, cx))
2069 case UNI_IE_RESTART:
2070 out->restart.h = *hdr;
2071 if (hdr->present & UNI_IE_ERROR)
2073 if(uni_decode_ie_body(UNI_IE_RESTART, (union uni_ieall *)&out->restart, msg, ielen, cx))
2078 out->unrec.h = *hdr;
2079 if (hdr->present & UNI_IE_ERROR)
2081 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
2091 static const struct msgdecl decl_restart = {
2094 (uni_msg_print_f)print_restart,
2095 (uni_msg_check_f)check_restart,
2096 (uni_msg_encode_f)encode_restart,
2097 (uni_msg_decode_f)decode_restart
2101 print_restart_ack(struct uni_restart_ack *msg, struct unicx *cx)
2103 if(msg->connid.h.present & UNI_IE_PRESENT)
2104 uni_print_ie_internal(UNI_IE_CONNID, (union uni_ieall *)&msg->connid, cx);
2105 if(msg->restart.h.present & UNI_IE_PRESENT)
2106 uni_print_ie_internal(UNI_IE_RESTART, (union uni_ieall *)&msg->restart, cx);
2107 if(msg->unrec.h.present & UNI_IE_PRESENT)
2108 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
2112 check_restart_ack(struct uni_restart_ack *m, struct unicx *cx)
2116 ret |= uni_check_ie(UNI_IE_CONNID, (union uni_ieall *)&m->connid, cx);
2117 ret |= uni_check_ie(UNI_IE_RESTART, (union uni_ieall *)&m->restart, cx);
2118 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
2124 encode_restart_ack(struct uni_msg *msg, struct uni_restart_ack *p, struct unicx *cx)
2128 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_RESTART_ACK, cx, &mlen))
2131 if((p->connid.h.present & UNI_IE_PRESENT) &&
2132 uni_encode_ie(UNI_IE_CONNID, msg, (union uni_ieall *)&p->connid, cx))
2133 return (UNI_IE_CONNID);
2134 if((p->restart.h.present & UNI_IE_PRESENT) &&
2135 uni_encode_ie(UNI_IE_RESTART, msg, (union uni_ieall *)&p->restart, cx))
2136 return (UNI_IE_RESTART);
2137 if((p->unrec.h.present & UNI_IE_PRESENT) &&
2138 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
2139 return (UNI_IE_UNREC);
2141 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
2142 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
2148 decode_restart_ack(struct uni_restart_ack *out, struct uni_msg *msg,
2149 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
2155 out->connid.h = *hdr;
2156 if (hdr->present & UNI_IE_ERROR)
2158 if(uni_decode_ie_body(UNI_IE_CONNID, (union uni_ieall *)&out->connid, msg, ielen, cx))
2162 case UNI_IE_RESTART:
2163 out->restart.h = *hdr;
2164 if (hdr->present & UNI_IE_ERROR)
2166 if(uni_decode_ie_body(UNI_IE_RESTART, (union uni_ieall *)&out->restart, msg, ielen, cx))
2171 out->unrec.h = *hdr;
2172 if (hdr->present & UNI_IE_ERROR)
2174 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
2184 static const struct msgdecl decl_restart_ack = {
2187 (uni_msg_print_f)print_restart_ack,
2188 (uni_msg_check_f)check_restart_ack,
2189 (uni_msg_encode_f)encode_restart_ack,
2190 (uni_msg_decode_f)decode_restart_ack
2194 print_add_party(struct uni_add_party *msg, struct unicx *cx)
2198 if(msg->aal.h.present & UNI_IE_PRESENT)
2199 uni_print_ie_internal(UNI_IE_AAL, (union uni_ieall *)&msg->aal, cx);
2200 if(msg->bhli.h.present & UNI_IE_PRESENT)
2201 uni_print_ie_internal(UNI_IE_BHLI, (union uni_ieall *)&msg->bhli, cx);
2202 if(msg->blli.h.present & UNI_IE_PRESENT)
2203 uni_print_ie_internal(UNI_IE_BLLI, (union uni_ieall *)&msg->blli, cx);
2204 if(msg->called.h.present & UNI_IE_PRESENT)
2205 uni_print_ie_internal(UNI_IE_CALLED, (union uni_ieall *)&msg->called, cx);
2206 for(i = 0; i < UNI_NUM_IE_CALLEDSUB; i++)
2207 if(msg->calledsub[i].h.present & UNI_IE_PRESENT)
2208 uni_print_ie_internal(UNI_IE_CALLEDSUB, (union uni_ieall *)&msg->calledsub[i], cx);
2209 if(msg->calling.h.present & UNI_IE_PRESENT)
2210 uni_print_ie_internal(UNI_IE_CALLING, (union uni_ieall *)&msg->calling, cx);
2211 for(i = 0; i < UNI_NUM_IE_CALLINGSUB; i++)
2212 if(msg->callingsub[i].h.present & UNI_IE_PRESENT)
2213 uni_print_ie_internal(UNI_IE_CALLINGSUB, (union uni_ieall *)&msg->callingsub[i], cx);
2214 if(msg->scompl.h.present & UNI_IE_PRESENT)
2215 uni_print_ie_internal(UNI_IE_SCOMPL, (union uni_ieall *)&msg->scompl, cx);
2216 for(i = 0; i < UNI_NUM_IE_TNS; i++)
2217 if(msg->tns[i].h.present & UNI_IE_PRESENT)
2218 uni_print_ie_internal(UNI_IE_TNS, (union uni_ieall *)&msg->tns[i], cx);
2219 if(msg->epref.h.present & UNI_IE_PRESENT)
2220 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
2221 if(msg->notify.h.present & UNI_IE_PRESENT)
2222 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
2223 if(msg->eetd.h.present & UNI_IE_PRESENT)
2224 uni_print_ie_internal(UNI_IE_EETD, (union uni_ieall *)&msg->eetd, cx);
2225 if(msg->uu.h.present & UNI_IE_PRESENT)
2226 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
2227 for(i = 0; i < UNI_NUM_IE_GIT; i++)
2228 if(msg->git[i].h.present & UNI_IE_PRESENT)
2229 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
2230 if(msg->lij_seqno.h.present & UNI_IE_PRESENT)
2231 uni_print_ie_internal(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&msg->lij_seqno, cx);
2232 if(msg->calling_soft.h.present & UNI_IE_PRESENT)
2233 uni_print_ie_internal(UNI_IE_CALLING_SOFT, (union uni_ieall *)&msg->calling_soft, cx);
2234 if(msg->called_soft.h.present & UNI_IE_PRESENT)
2235 uni_print_ie_internal(UNI_IE_CALLED_SOFT, (union uni_ieall *)&msg->called_soft, cx);
2236 if(msg->dtl_repeat.h.present & UNI_IE_PRESENT)
2237 uni_print_ie_internal(UNI_IE_REPEAT, (union uni_ieall *)&msg->dtl_repeat, cx);
2238 for(i = 0; i < UNI_NUM_IE_DTL; i++)
2239 if(msg->dtl[i].h.present & UNI_IE_PRESENT)
2240 uni_print_ie_internal(UNI_IE_DTL, (union uni_ieall *)&msg->dtl[i], cx);
2241 if(msg->unrec.h.present & UNI_IE_PRESENT)
2242 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
2246 check_add_party(struct uni_add_party *m, struct unicx *cx)
2251 ret |= uni_check_ie(UNI_IE_AAL, (union uni_ieall *)&m->aal, cx);
2252 ret |= uni_check_ie(UNI_IE_BHLI, (union uni_ieall *)&m->bhli, cx);
2253 ret |= uni_check_ie(UNI_IE_BLLI, (union uni_ieall *)&m->blli, cx);
2254 ret |= uni_check_ie(UNI_IE_CALLED, (union uni_ieall *)&m->called, cx);
2255 for(i = 0; i < UNI_NUM_IE_CALLEDSUB ; i++) {
2256 ret |= uni_check_ie(UNI_IE_CALLEDSUB, (union uni_ieall *)&m->calledsub[i], cx);
2258 ret |= uni_check_ie(UNI_IE_CALLING, (union uni_ieall *)&m->calling, cx);
2259 for(i = 0; i < UNI_NUM_IE_CALLINGSUB ; i++) {
2260 ret |= uni_check_ie(UNI_IE_CALLINGSUB, (union uni_ieall *)&m->callingsub[i], cx);
2263 ret |= IE_ISPRESENT(m->scompl);
2265 ret |= uni_check_ie(UNI_IE_SCOMPL, (union uni_ieall *)&m->scompl, cx);
2266 for(i = 0; i < UNI_NUM_IE_TNS ; i++) {
2267 ret |= uni_check_ie(UNI_IE_TNS, (union uni_ieall *)&m->tns[i], cx);
2269 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
2270 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
2271 ret |= uni_check_ie(UNI_IE_EETD, (union uni_ieall *)&m->eetd, cx);
2273 ret |= IE_ISPRESENT(m->uu);
2275 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
2276 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
2277 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
2280 ret |= IE_ISPRESENT(m->lij_seqno);
2282 ret |= uni_check_ie(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&m->lij_seqno, cx);
2284 ret |= IE_ISPRESENT(m->calling_soft);
2286 ret |= uni_check_ie(UNI_IE_CALLING_SOFT, (union uni_ieall *)&m->calling_soft, cx);
2288 ret |= IE_ISPRESENT(m->called_soft);
2290 ret |= uni_check_ie(UNI_IE_CALLED_SOFT, (union uni_ieall *)&m->called_soft, cx);
2292 ret |= IE_ISPRESENT(m->dtl_repeat);
2294 ret |= uni_check_ie(UNI_IE_REPEAT, (union uni_ieall *)&m->dtl_repeat, cx);
2295 for(i = 0; i < UNI_NUM_IE_DTL ; i++) {
2297 ret |= IE_ISPRESENT(m->dtl[i]);
2299 ret |= uni_check_ie(UNI_IE_DTL, (union uni_ieall *)&m->dtl[i], cx);
2301 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
2307 encode_add_party(struct uni_msg *msg, struct uni_add_party *p, struct unicx *cx)
2312 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_ADD_PARTY, cx, &mlen))
2315 if((p->aal.h.present & UNI_IE_PRESENT) &&
2316 uni_encode_ie(UNI_IE_AAL, msg, (union uni_ieall *)&p->aal, cx))
2317 return (UNI_IE_AAL);
2318 if((p->bhli.h.present & UNI_IE_PRESENT) &&
2319 uni_encode_ie(UNI_IE_BHLI, msg, (union uni_ieall *)&p->bhli, cx))
2320 return (UNI_IE_BHLI);
2321 if((p->blli.h.present & UNI_IE_PRESENT) &&
2322 uni_encode_ie(UNI_IE_BLLI, msg, (union uni_ieall *)&p->blli, cx))
2323 return (UNI_IE_BLLI);
2324 if((p->called.h.present & UNI_IE_PRESENT) &&
2325 uni_encode_ie(UNI_IE_CALLED, msg, (union uni_ieall *)&p->called, cx))
2326 return (UNI_IE_CALLED);
2327 for(i = 0; i < UNI_NUM_IE_CALLEDSUB; i++)
2328 if((p->calledsub[i].h.present & UNI_IE_PRESENT) &&
2329 uni_encode_ie(UNI_IE_CALLEDSUB, msg, (union uni_ieall *)&p->calledsub[i], cx))
2330 return ((i << 16) + UNI_IE_CALLEDSUB);
2331 if((p->calling.h.present & UNI_IE_PRESENT) &&
2332 uni_encode_ie(UNI_IE_CALLING, msg, (union uni_ieall *)&p->calling, cx))
2333 return (UNI_IE_CALLING);
2334 for(i = 0; i < UNI_NUM_IE_CALLINGSUB; i++)
2335 if((p->callingsub[i].h.present & UNI_IE_PRESENT) &&
2336 uni_encode_ie(UNI_IE_CALLINGSUB, msg, (union uni_ieall *)&p->callingsub[i], cx))
2337 return ((i << 16) + UNI_IE_CALLINGSUB);
2338 if((p->scompl.h.present & UNI_IE_PRESENT) &&
2339 uni_encode_ie(UNI_IE_SCOMPL, msg, (union uni_ieall *)&p->scompl, cx))
2340 return (UNI_IE_SCOMPL);
2341 for(i = 0; i < UNI_NUM_IE_TNS; i++)
2342 if((p->tns[i].h.present & UNI_IE_PRESENT) &&
2343 uni_encode_ie(UNI_IE_TNS, msg, (union uni_ieall *)&p->tns[i], cx))
2344 return ((i << 16) + UNI_IE_TNS);
2345 if((p->epref.h.present & UNI_IE_PRESENT) &&
2346 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
2347 return (UNI_IE_EPREF);
2348 if((p->notify.h.present & UNI_IE_PRESENT) &&
2349 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
2350 return (UNI_IE_NOTIFY);
2351 if((p->eetd.h.present & UNI_IE_PRESENT) &&
2352 uni_encode_ie(UNI_IE_EETD, msg, (union uni_ieall *)&p->eetd, cx))
2353 return (UNI_IE_EETD);
2354 if((p->uu.h.present & UNI_IE_PRESENT) &&
2355 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
2357 for(i = 0; i < UNI_NUM_IE_GIT; i++)
2358 if((p->git[i].h.present & UNI_IE_PRESENT) &&
2359 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
2360 return ((i << 16) + UNI_IE_GIT);
2361 if((p->lij_seqno.h.present & UNI_IE_PRESENT) &&
2362 uni_encode_ie(UNI_IE_LIJ_SEQNO, msg, (union uni_ieall *)&p->lij_seqno, cx))
2363 return (UNI_IE_LIJ_SEQNO);
2364 if((p->calling_soft.h.present & UNI_IE_PRESENT) &&
2365 uni_encode_ie(UNI_IE_CALLING_SOFT, msg, (union uni_ieall *)&p->calling_soft, cx))
2366 return (UNI_IE_CALLING_SOFT);
2367 if((p->called_soft.h.present & UNI_IE_PRESENT) &&
2368 uni_encode_ie(UNI_IE_CALLED_SOFT, msg, (union uni_ieall *)&p->called_soft, cx))
2369 return (UNI_IE_CALLED_SOFT);
2370 if((p->dtl_repeat.h.present & UNI_IE_PRESENT) &&
2371 uni_encode_ie(UNI_IE_DTL, msg, (union uni_ieall *)&p->dtl_repeat, cx))
2372 return (0x10000000 + UNI_IE_DTL);
2373 for(i = 0; i < UNI_NUM_IE_DTL; i++)
2374 if((p->dtl[i].h.present & UNI_IE_PRESENT) &&
2375 uni_encode_ie(UNI_IE_DTL, msg, (union uni_ieall *)&p->dtl[i], cx))
2376 return ((i << 16) + UNI_IE_DTL);
2377 if((p->unrec.h.present & UNI_IE_PRESENT) &&
2378 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
2379 return (UNI_IE_UNREC);
2381 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
2382 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
2388 decode_add_party(struct uni_add_party *out, struct uni_msg *msg,
2389 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
2398 if (hdr->present & UNI_IE_ERROR)
2400 if(uni_decode_ie_body(UNI_IE_AAL, (union uni_ieall *)&out->aal, msg, ielen, cx))
2406 if (hdr->present & UNI_IE_ERROR)
2408 if(uni_decode_ie_body(UNI_IE_BHLI, (union uni_ieall *)&out->bhli, msg, ielen, cx))
2414 if (hdr->present & UNI_IE_ERROR)
2416 if(uni_decode_ie_body(UNI_IE_BLLI, (union uni_ieall *)&out->blli, msg, ielen, cx))
2421 out->called.h = *hdr;
2422 if (hdr->present & UNI_IE_ERROR)
2424 if(uni_decode_ie_body(UNI_IE_CALLED, (union uni_ieall *)&out->called, msg, ielen, cx))
2428 case UNI_IE_CALLEDSUB:
2429 for(i = 0; i < UNI_NUM_IE_CALLEDSUB; i++)
2430 if (!IE_ISPRESENT(out->calledsub[i])) {
2431 out->calledsub[i].h = *hdr;
2432 if (hdr->present & UNI_IE_ERROR)
2434 if(uni_decode_ie_body(UNI_IE_CALLEDSUB, (union uni_ieall *)&out->calledsub[i], msg, ielen, cx))
2440 case UNI_IE_CALLING:
2441 out->calling.h = *hdr;
2442 if (hdr->present & UNI_IE_ERROR)
2444 if(uni_decode_ie_body(UNI_IE_CALLING, (union uni_ieall *)&out->calling, msg, ielen, cx))
2448 case UNI_IE_CALLINGSUB:
2449 for(i = 0; i < UNI_NUM_IE_CALLINGSUB; i++)
2450 if (!IE_ISPRESENT(out->callingsub[i])) {
2451 out->callingsub[i].h = *hdr;
2452 if (hdr->present & UNI_IE_ERROR)
2454 if(uni_decode_ie_body(UNI_IE_CALLINGSUB, (union uni_ieall *)&out->callingsub[i], msg, ielen, cx))
2463 out->scompl.h = *hdr;
2464 if (hdr->present & UNI_IE_ERROR)
2466 if(uni_decode_ie_body(UNI_IE_SCOMPL, (union uni_ieall *)&out->scompl, msg, ielen, cx))
2471 for(i = 0; i < UNI_NUM_IE_TNS; i++)
2472 if (!IE_ISPRESENT(out->tns[i])) {
2473 out->tns[i].h = *hdr;
2474 if (hdr->present & UNI_IE_ERROR)
2476 if(uni_decode_ie_body(UNI_IE_TNS, (union uni_ieall *)&out->tns[i], msg, ielen, cx))
2483 out->epref.h = *hdr;
2484 if (hdr->present & UNI_IE_ERROR)
2486 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
2491 out->notify.h = *hdr;
2492 if (hdr->present & UNI_IE_ERROR)
2494 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
2500 if (hdr->present & UNI_IE_ERROR)
2502 if(uni_decode_ie_body(UNI_IE_EETD, (union uni_ieall *)&out->eetd, msg, ielen, cx))
2510 if (hdr->present & UNI_IE_ERROR)
2512 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
2517 for(i = 0; i < UNI_NUM_IE_GIT; i++)
2518 if (!IE_ISPRESENT(out->git[i])) {
2519 out->git[i].h = *hdr;
2520 if (hdr->present & UNI_IE_ERROR)
2522 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
2528 case UNI_IE_LIJ_SEQNO:
2531 out->lij_seqno.h = *hdr;
2532 if (hdr->present & UNI_IE_ERROR)
2534 if(uni_decode_ie_body(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&out->lij_seqno, msg, ielen, cx))
2538 case UNI_IE_CALLING_SOFT:
2541 out->calling_soft.h = *hdr;
2542 if (hdr->present & UNI_IE_ERROR)
2544 if(uni_decode_ie_body(UNI_IE_CALLING_SOFT, (union uni_ieall *)&out->calling_soft, msg, ielen, cx))
2548 case UNI_IE_CALLED_SOFT:
2551 out->called_soft.h = *hdr;
2552 if (hdr->present & UNI_IE_ERROR)
2554 if(uni_decode_ie_body(UNI_IE_CALLED_SOFT, (union uni_ieall *)&out->called_soft, msg, ielen, cx))
2561 if (IE_ISPRESENT(cx->repeat))
2562 out->dtl_repeat = cx->repeat;
2563 for(i = 0; i < UNI_NUM_IE_DTL; i++)
2564 if (!IE_ISPRESENT(out->dtl[i])) {
2565 out->dtl[i].h = *hdr;
2566 if (hdr->present & UNI_IE_ERROR)
2568 if(uni_decode_ie_body(UNI_IE_DTL, (union uni_ieall *)&out->dtl[i], msg, ielen, cx))
2575 out->unrec.h = *hdr;
2576 if (hdr->present & UNI_IE_ERROR)
2578 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
2583 cx->repeat.h = *hdr;
2584 if (hdr->present & UNI_IE_ERROR)
2586 if (uni_decode_ie_body(UNI_IE_REPEAT, (union uni_ieall *)&cx->repeat, msg, ielen, cx))
2596 static const struct msgdecl decl_add_party = {
2599 (uni_msg_print_f)print_add_party,
2600 (uni_msg_check_f)check_add_party,
2601 (uni_msg_encode_f)encode_add_party,
2602 (uni_msg_decode_f)decode_add_party
2606 print_add_party_ack(struct uni_add_party_ack *msg, struct unicx *cx)
2610 if(msg->epref.h.present & UNI_IE_PRESENT)
2611 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
2612 if(msg->aal.h.present & UNI_IE_PRESENT)
2613 uni_print_ie_internal(UNI_IE_AAL, (union uni_ieall *)&msg->aal, cx);
2614 if(msg->blli.h.present & UNI_IE_PRESENT)
2615 uni_print_ie_internal(UNI_IE_BLLI, (union uni_ieall *)&msg->blli, cx);
2616 if(msg->notify.h.present & UNI_IE_PRESENT)
2617 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
2618 if(msg->eetd.h.present & UNI_IE_PRESENT)
2619 uni_print_ie_internal(UNI_IE_EETD, (union uni_ieall *)&msg->eetd, cx);
2620 if(msg->conned.h.present & UNI_IE_PRESENT)
2621 uni_print_ie_internal(UNI_IE_CONNED, (union uni_ieall *)&msg->conned, cx);
2622 if(msg->connedsub.h.present & UNI_IE_PRESENT)
2623 uni_print_ie_internal(UNI_IE_CONNEDSUB, (union uni_ieall *)&msg->connedsub, cx);
2624 if(msg->uu.h.present & UNI_IE_PRESENT)
2625 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
2626 for(i = 0; i < UNI_NUM_IE_GIT; i++)
2627 if(msg->git[i].h.present & UNI_IE_PRESENT)
2628 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
2629 if(msg->called_soft.h.present & UNI_IE_PRESENT)
2630 uni_print_ie_internal(UNI_IE_CALLED_SOFT, (union uni_ieall *)&msg->called_soft, cx);
2631 if(msg->unrec.h.present & UNI_IE_PRESENT)
2632 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
2636 check_add_party_ack(struct uni_add_party_ack *m, struct unicx *cx)
2641 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
2642 ret |= uni_check_ie(UNI_IE_AAL, (union uni_ieall *)&m->aal, cx);
2643 ret |= uni_check_ie(UNI_IE_BLLI, (union uni_ieall *)&m->blli, cx);
2644 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
2645 ret |= uni_check_ie(UNI_IE_EETD, (union uni_ieall *)&m->eetd, cx);
2646 ret |= uni_check_ie(UNI_IE_CONNED, (union uni_ieall *)&m->conned, cx);
2647 ret |= uni_check_ie(UNI_IE_CONNEDSUB, (union uni_ieall *)&m->connedsub, cx);
2649 ret |= IE_ISPRESENT(m->uu);
2651 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
2652 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
2653 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
2656 ret |= IE_ISPRESENT(m->called_soft);
2658 ret |= uni_check_ie(UNI_IE_CALLED_SOFT, (union uni_ieall *)&m->called_soft, cx);
2659 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
2665 encode_add_party_ack(struct uni_msg *msg, struct uni_add_party_ack *p, struct unicx *cx)
2670 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_ADD_PARTY_ACK, cx, &mlen))
2673 if((p->epref.h.present & UNI_IE_PRESENT) &&
2674 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
2675 return (UNI_IE_EPREF);
2676 if((p->aal.h.present & UNI_IE_PRESENT) &&
2677 uni_encode_ie(UNI_IE_AAL, msg, (union uni_ieall *)&p->aal, cx))
2678 return (UNI_IE_AAL);
2679 if((p->blli.h.present & UNI_IE_PRESENT) &&
2680 uni_encode_ie(UNI_IE_BLLI, msg, (union uni_ieall *)&p->blli, cx))
2681 return (UNI_IE_BLLI);
2682 if((p->notify.h.present & UNI_IE_PRESENT) &&
2683 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
2684 return (UNI_IE_NOTIFY);
2685 if((p->eetd.h.present & UNI_IE_PRESENT) &&
2686 uni_encode_ie(UNI_IE_EETD, msg, (union uni_ieall *)&p->eetd, cx))
2687 return (UNI_IE_EETD);
2688 if((p->conned.h.present & UNI_IE_PRESENT) &&
2689 uni_encode_ie(UNI_IE_CONNED, msg, (union uni_ieall *)&p->conned, cx))
2690 return (UNI_IE_CONNED);
2691 if((p->connedsub.h.present & UNI_IE_PRESENT) &&
2692 uni_encode_ie(UNI_IE_CONNEDSUB, msg, (union uni_ieall *)&p->connedsub, cx))
2693 return (UNI_IE_CONNEDSUB);
2694 if((p->uu.h.present & UNI_IE_PRESENT) &&
2695 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
2697 for(i = 0; i < UNI_NUM_IE_GIT; i++)
2698 if((p->git[i].h.present & UNI_IE_PRESENT) &&
2699 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
2700 return ((i << 16) + UNI_IE_GIT);
2701 if((p->called_soft.h.present & UNI_IE_PRESENT) &&
2702 uni_encode_ie(UNI_IE_CALLED_SOFT, msg, (union uni_ieall *)&p->called_soft, cx))
2703 return (UNI_IE_CALLED_SOFT);
2704 if((p->unrec.h.present & UNI_IE_PRESENT) &&
2705 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
2706 return (UNI_IE_UNREC);
2708 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
2709 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
2715 decode_add_party_ack(struct uni_add_party_ack *out, struct uni_msg *msg,
2716 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
2724 out->epref.h = *hdr;
2725 if (hdr->present & UNI_IE_ERROR)
2727 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
2733 if (hdr->present & UNI_IE_ERROR)
2735 if(uni_decode_ie_body(UNI_IE_AAL, (union uni_ieall *)&out->aal, msg, ielen, cx))
2741 if (hdr->present & UNI_IE_ERROR)
2743 if(uni_decode_ie_body(UNI_IE_BLLI, (union uni_ieall *)&out->blli, msg, ielen, cx))
2748 out->notify.h = *hdr;
2749 if (hdr->present & UNI_IE_ERROR)
2751 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
2757 if (hdr->present & UNI_IE_ERROR)
2759 if(uni_decode_ie_body(UNI_IE_EETD, (union uni_ieall *)&out->eetd, msg, ielen, cx))
2764 out->conned.h = *hdr;
2765 if (hdr->present & UNI_IE_ERROR)
2767 if(uni_decode_ie_body(UNI_IE_CONNED, (union uni_ieall *)&out->conned, msg, ielen, cx))
2771 case UNI_IE_CONNEDSUB:
2772 out->connedsub.h = *hdr;
2773 if (hdr->present & UNI_IE_ERROR)
2775 if(uni_decode_ie_body(UNI_IE_CONNEDSUB, (union uni_ieall *)&out->connedsub, msg, ielen, cx))
2783 if (hdr->present & UNI_IE_ERROR)
2785 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
2790 for(i = 0; i < UNI_NUM_IE_GIT; i++)
2791 if (!IE_ISPRESENT(out->git[i])) {
2792 out->git[i].h = *hdr;
2793 if (hdr->present & UNI_IE_ERROR)
2795 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
2801 case UNI_IE_CALLED_SOFT:
2804 out->called_soft.h = *hdr;
2805 if (hdr->present & UNI_IE_ERROR)
2807 if(uni_decode_ie_body(UNI_IE_CALLED_SOFT, (union uni_ieall *)&out->called_soft, msg, ielen, cx))
2812 out->unrec.h = *hdr;
2813 if (hdr->present & UNI_IE_ERROR)
2815 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
2825 static const struct msgdecl decl_add_party_ack = {
2828 (uni_msg_print_f)print_add_party_ack,
2829 (uni_msg_check_f)check_add_party_ack,
2830 (uni_msg_encode_f)encode_add_party_ack,
2831 (uni_msg_decode_f)decode_add_party_ack
2835 print_party_alerting(struct uni_party_alerting *msg, struct unicx *cx)
2839 if(msg->epref.h.present & UNI_IE_PRESENT)
2840 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
2841 if(msg->notify.h.present & UNI_IE_PRESENT)
2842 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
2843 if(msg->uu.h.present & UNI_IE_PRESENT)
2844 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
2845 for(i = 0; i < UNI_NUM_IE_GIT; i++)
2846 if(msg->git[i].h.present & UNI_IE_PRESENT)
2847 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
2848 if(msg->unrec.h.present & UNI_IE_PRESENT)
2849 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
2853 check_party_alerting(struct uni_party_alerting *m, struct unicx *cx)
2858 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
2859 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
2861 ret |= IE_ISPRESENT(m->uu);
2863 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
2864 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
2865 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
2867 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
2873 encode_party_alerting(struct uni_msg *msg, struct uni_party_alerting *p, struct unicx *cx)
2878 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_PARTY_ALERTING, cx, &mlen))
2881 if((p->epref.h.present & UNI_IE_PRESENT) &&
2882 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
2883 return (UNI_IE_EPREF);
2884 if((p->notify.h.present & UNI_IE_PRESENT) &&
2885 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
2886 return (UNI_IE_NOTIFY);
2887 if((p->uu.h.present & UNI_IE_PRESENT) &&
2888 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
2890 for(i = 0; i < UNI_NUM_IE_GIT; i++)
2891 if((p->git[i].h.present & UNI_IE_PRESENT) &&
2892 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
2893 return ((i << 16) + UNI_IE_GIT);
2894 if((p->unrec.h.present & UNI_IE_PRESENT) &&
2895 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
2896 return (UNI_IE_UNREC);
2898 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
2899 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
2905 decode_party_alerting(struct uni_party_alerting *out, struct uni_msg *msg,
2906 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
2914 out->epref.h = *hdr;
2915 if (hdr->present & UNI_IE_ERROR)
2917 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
2922 out->notify.h = *hdr;
2923 if (hdr->present & UNI_IE_ERROR)
2925 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
2933 if (hdr->present & UNI_IE_ERROR)
2935 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
2940 for(i = 0; i < UNI_NUM_IE_GIT; i++)
2941 if (!IE_ISPRESENT(out->git[i])) {
2942 out->git[i].h = *hdr;
2943 if (hdr->present & UNI_IE_ERROR)
2945 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
2952 out->unrec.h = *hdr;
2953 if (hdr->present & UNI_IE_ERROR)
2955 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
2965 static const struct msgdecl decl_party_alerting = {
2968 (uni_msg_print_f)print_party_alerting,
2969 (uni_msg_check_f)check_party_alerting,
2970 (uni_msg_encode_f)encode_party_alerting,
2971 (uni_msg_decode_f)decode_party_alerting
2975 print_add_party_rej(struct uni_add_party_rej *msg, struct unicx *cx)
2979 if(msg->cause.h.present & UNI_IE_PRESENT)
2980 uni_print_ie_internal(UNI_IE_CAUSE, (union uni_ieall *)&msg->cause, cx);
2981 if(msg->epref.h.present & UNI_IE_PRESENT)
2982 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
2983 if(msg->uu.h.present & UNI_IE_PRESENT)
2984 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
2985 for(i = 0; i < UNI_NUM_IE_GIT; i++)
2986 if(msg->git[i].h.present & UNI_IE_PRESENT)
2987 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
2988 if(msg->crankback.h.present & UNI_IE_PRESENT)
2989 uni_print_ie_internal(UNI_IE_CRANKBACK, (union uni_ieall *)&msg->crankback, cx);
2990 if(msg->unrec.h.present & UNI_IE_PRESENT)
2991 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
2995 check_add_party_rej(struct uni_add_party_rej *m, struct unicx *cx)
3000 ret |= uni_check_ie(UNI_IE_CAUSE, (union uni_ieall *)&m->cause, cx);
3001 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
3003 ret |= IE_ISPRESENT(m->uu);
3005 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
3006 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
3007 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
3010 ret |= IE_ISPRESENT(m->crankback);
3012 ret |= uni_check_ie(UNI_IE_CRANKBACK, (union uni_ieall *)&m->crankback, cx);
3013 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
3019 encode_add_party_rej(struct uni_msg *msg, struct uni_add_party_rej *p, struct unicx *cx)
3024 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_ADD_PARTY_REJ, cx, &mlen))
3027 if((p->cause.h.present & UNI_IE_PRESENT) &&
3028 uni_encode_ie(UNI_IE_CAUSE, msg, (union uni_ieall *)&p->cause, cx))
3029 return (UNI_IE_CAUSE);
3030 if((p->epref.h.present & UNI_IE_PRESENT) &&
3031 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
3032 return (UNI_IE_EPREF);
3033 if((p->uu.h.present & UNI_IE_PRESENT) &&
3034 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
3036 for(i = 0; i < UNI_NUM_IE_GIT; i++)
3037 if((p->git[i].h.present & UNI_IE_PRESENT) &&
3038 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
3039 return ((i << 16) + UNI_IE_GIT);
3040 if((p->crankback.h.present & UNI_IE_PRESENT) &&
3041 uni_encode_ie(UNI_IE_CRANKBACK, msg, (union uni_ieall *)&p->crankback, cx))
3042 return (UNI_IE_CRANKBACK);
3043 if((p->unrec.h.present & UNI_IE_PRESENT) &&
3044 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
3045 return (UNI_IE_UNREC);
3047 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
3048 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
3054 decode_add_party_rej(struct uni_add_party_rej *out, struct uni_msg *msg,
3055 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
3063 out->cause.h = *hdr;
3064 if (hdr->present & UNI_IE_ERROR)
3066 if(uni_decode_ie_body(UNI_IE_CAUSE, (union uni_ieall *)&out->cause, msg, ielen, cx))
3071 out->epref.h = *hdr;
3072 if (hdr->present & UNI_IE_ERROR)
3074 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
3082 if (hdr->present & UNI_IE_ERROR)
3084 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
3089 for(i = 0; i < UNI_NUM_IE_GIT; i++)
3090 if (!IE_ISPRESENT(out->git[i])) {
3091 out->git[i].h = *hdr;
3092 if (hdr->present & UNI_IE_ERROR)
3094 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
3100 case UNI_IE_CRANKBACK:
3103 out->crankback.h = *hdr;
3104 if (hdr->present & UNI_IE_ERROR)
3106 if(uni_decode_ie_body(UNI_IE_CRANKBACK, (union uni_ieall *)&out->crankback, msg, ielen, cx))
3111 out->unrec.h = *hdr;
3112 if (hdr->present & UNI_IE_ERROR)
3114 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
3124 static const struct msgdecl decl_add_party_rej = {
3127 (uni_msg_print_f)print_add_party_rej,
3128 (uni_msg_check_f)check_add_party_rej,
3129 (uni_msg_encode_f)encode_add_party_rej,
3130 (uni_msg_decode_f)decode_add_party_rej
3134 print_drop_party(struct uni_drop_party *msg, struct unicx *cx)
3138 if(msg->cause.h.present & UNI_IE_PRESENT)
3139 uni_print_ie_internal(UNI_IE_CAUSE, (union uni_ieall *)&msg->cause, cx);
3140 if(msg->epref.h.present & UNI_IE_PRESENT)
3141 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
3142 if(msg->notify.h.present & UNI_IE_PRESENT)
3143 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
3144 if(msg->uu.h.present & UNI_IE_PRESENT)
3145 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
3146 for(i = 0; i < UNI_NUM_IE_GIT; i++)
3147 if(msg->git[i].h.present & UNI_IE_PRESENT)
3148 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
3149 if(msg->unrec.h.present & UNI_IE_PRESENT)
3150 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
3154 check_drop_party(struct uni_drop_party *m, struct unicx *cx)
3159 ret |= uni_check_ie(UNI_IE_CAUSE, (union uni_ieall *)&m->cause, cx);
3160 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
3161 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
3163 ret |= IE_ISPRESENT(m->uu);
3165 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
3166 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
3167 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
3169 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
3175 encode_drop_party(struct uni_msg *msg, struct uni_drop_party *p, struct unicx *cx)
3180 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_DROP_PARTY, cx, &mlen))
3183 if((p->cause.h.present & UNI_IE_PRESENT) &&
3184 uni_encode_ie(UNI_IE_CAUSE, msg, (union uni_ieall *)&p->cause, cx))
3185 return (UNI_IE_CAUSE);
3186 if((p->epref.h.present & UNI_IE_PRESENT) &&
3187 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
3188 return (UNI_IE_EPREF);
3189 if((p->notify.h.present & UNI_IE_PRESENT) &&
3190 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
3191 return (UNI_IE_NOTIFY);
3192 if((p->uu.h.present & UNI_IE_PRESENT) &&
3193 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
3195 for(i = 0; i < UNI_NUM_IE_GIT; i++)
3196 if((p->git[i].h.present & UNI_IE_PRESENT) &&
3197 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
3198 return ((i << 16) + UNI_IE_GIT);
3199 if((p->unrec.h.present & UNI_IE_PRESENT) &&
3200 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
3201 return (UNI_IE_UNREC);
3203 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
3204 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
3210 decode_drop_party(struct uni_drop_party *out, struct uni_msg *msg,
3211 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
3219 out->cause.h = *hdr;
3220 if (hdr->present & UNI_IE_ERROR)
3222 if(uni_decode_ie_body(UNI_IE_CAUSE, (union uni_ieall *)&out->cause, msg, ielen, cx))
3227 out->epref.h = *hdr;
3228 if (hdr->present & UNI_IE_ERROR)
3230 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
3235 out->notify.h = *hdr;
3236 if (hdr->present & UNI_IE_ERROR)
3238 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
3246 if (hdr->present & UNI_IE_ERROR)
3248 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
3253 for(i = 0; i < UNI_NUM_IE_GIT; i++)
3254 if (!IE_ISPRESENT(out->git[i])) {
3255 out->git[i].h = *hdr;
3256 if (hdr->present & UNI_IE_ERROR)
3258 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
3265 out->unrec.h = *hdr;
3266 if (hdr->present & UNI_IE_ERROR)
3268 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
3278 static const struct msgdecl decl_drop_party = {
3281 (uni_msg_print_f)print_drop_party,
3282 (uni_msg_check_f)check_drop_party,
3283 (uni_msg_encode_f)encode_drop_party,
3284 (uni_msg_decode_f)decode_drop_party
3288 print_drop_party_ack(struct uni_drop_party_ack *msg, struct unicx *cx)
3292 if(msg->epref.h.present & UNI_IE_PRESENT)
3293 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
3294 if(msg->cause.h.present & UNI_IE_PRESENT)
3295 uni_print_ie_internal(UNI_IE_CAUSE, (union uni_ieall *)&msg->cause, cx);
3296 if(msg->uu.h.present & UNI_IE_PRESENT)
3297 uni_print_ie_internal(UNI_IE_UU, (union uni_ieall *)&msg->uu, cx);
3298 for(i = 0; i < UNI_NUM_IE_GIT; i++)
3299 if(msg->git[i].h.present & UNI_IE_PRESENT)
3300 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
3301 if(msg->unrec.h.present & UNI_IE_PRESENT)
3302 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
3306 check_drop_party_ack(struct uni_drop_party_ack *m, struct unicx *cx)
3311 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
3312 ret |= uni_check_ie(UNI_IE_CAUSE, (union uni_ieall *)&m->cause, cx);
3314 ret |= IE_ISPRESENT(m->uu);
3316 ret |= uni_check_ie(UNI_IE_UU, (union uni_ieall *)&m->uu, cx);
3317 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
3318 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
3320 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
3326 encode_drop_party_ack(struct uni_msg *msg, struct uni_drop_party_ack *p, struct unicx *cx)
3331 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_DROP_PARTY_ACK, cx, &mlen))
3334 if((p->epref.h.present & UNI_IE_PRESENT) &&
3335 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
3336 return (UNI_IE_EPREF);
3337 if((p->cause.h.present & UNI_IE_PRESENT) &&
3338 uni_encode_ie(UNI_IE_CAUSE, msg, (union uni_ieall *)&p->cause, cx))
3339 return (UNI_IE_CAUSE);
3340 if((p->uu.h.present & UNI_IE_PRESENT) &&
3341 uni_encode_ie(UNI_IE_UU, msg, (union uni_ieall *)&p->uu, cx))
3343 for(i = 0; i < UNI_NUM_IE_GIT; i++)
3344 if((p->git[i].h.present & UNI_IE_PRESENT) &&
3345 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
3346 return ((i << 16) + UNI_IE_GIT);
3347 if((p->unrec.h.present & UNI_IE_PRESENT) &&
3348 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
3349 return (UNI_IE_UNREC);
3351 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
3352 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
3358 decode_drop_party_ack(struct uni_drop_party_ack *out, struct uni_msg *msg,
3359 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
3367 out->epref.h = *hdr;
3368 if (hdr->present & UNI_IE_ERROR)
3370 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
3375 out->cause.h = *hdr;
3376 if (hdr->present & UNI_IE_ERROR)
3378 if(uni_decode_ie_body(UNI_IE_CAUSE, (union uni_ieall *)&out->cause, msg, ielen, cx))
3386 if (hdr->present & UNI_IE_ERROR)
3388 if(uni_decode_ie_body(UNI_IE_UU, (union uni_ieall *)&out->uu, msg, ielen, cx))
3393 for(i = 0; i < UNI_NUM_IE_GIT; i++)
3394 if (!IE_ISPRESENT(out->git[i])) {
3395 out->git[i].h = *hdr;
3396 if (hdr->present & UNI_IE_ERROR)
3398 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
3405 out->unrec.h = *hdr;
3406 if (hdr->present & UNI_IE_ERROR)
3408 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
3418 static const struct msgdecl decl_drop_party_ack = {
3421 (uni_msg_print_f)print_drop_party_ack,
3422 (uni_msg_check_f)check_drop_party_ack,
3423 (uni_msg_encode_f)encode_drop_party_ack,
3424 (uni_msg_decode_f)decode_drop_party_ack
3428 print_leaf_setup_req(struct uni_leaf_setup_req *msg, struct unicx *cx)
3432 for(i = 0; i < UNI_NUM_IE_TNS; i++)
3433 if(msg->tns[i].h.present & UNI_IE_PRESENT)
3434 uni_print_ie_internal(UNI_IE_TNS, (union uni_ieall *)&msg->tns[i], cx);
3435 if(msg->calling.h.present & UNI_IE_PRESENT)
3436 uni_print_ie_internal(UNI_IE_CALLING, (union uni_ieall *)&msg->calling, cx);
3437 for(i = 0; i < UNI_NUM_IE_CALLINGSUB; i++)
3438 if(msg->callingsub[i].h.present & UNI_IE_PRESENT)
3439 uni_print_ie_internal(UNI_IE_CALLINGSUB, (union uni_ieall *)&msg->callingsub[i], cx);
3440 if(msg->called.h.present & UNI_IE_PRESENT)
3441 uni_print_ie_internal(UNI_IE_CALLED, (union uni_ieall *)&msg->called, cx);
3442 for(i = 0; i < UNI_NUM_IE_CALLEDSUB; i++)
3443 if(msg->calledsub[i].h.present & UNI_IE_PRESENT)
3444 uni_print_ie_internal(UNI_IE_CALLEDSUB, (union uni_ieall *)&msg->calledsub[i], cx);
3445 if(msg->lij_callid.h.present & UNI_IE_PRESENT)
3446 uni_print_ie_internal(UNI_IE_LIJ_CALLID, (union uni_ieall *)&msg->lij_callid, cx);
3447 if(msg->lij_seqno.h.present & UNI_IE_PRESENT)
3448 uni_print_ie_internal(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&msg->lij_seqno, cx);
3449 if(msg->unrec.h.present & UNI_IE_PRESENT)
3450 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
3454 check_leaf_setup_req(struct uni_leaf_setup_req *m, struct unicx *cx)
3459 for(i = 0; i < UNI_NUM_IE_TNS ; i++) {
3460 ret |= uni_check_ie(UNI_IE_TNS, (union uni_ieall *)&m->tns[i], cx);
3462 ret |= uni_check_ie(UNI_IE_CALLING, (union uni_ieall *)&m->calling, cx);
3463 for(i = 0; i < UNI_NUM_IE_CALLINGSUB ; i++) {
3464 ret |= uni_check_ie(UNI_IE_CALLINGSUB, (union uni_ieall *)&m->callingsub[i], cx);
3466 ret |= uni_check_ie(UNI_IE_CALLED, (union uni_ieall *)&m->called, cx);
3467 for(i = 0; i < UNI_NUM_IE_CALLEDSUB ; i++) {
3468 ret |= uni_check_ie(UNI_IE_CALLEDSUB, (union uni_ieall *)&m->calledsub[i], cx);
3470 ret |= uni_check_ie(UNI_IE_LIJ_CALLID, (union uni_ieall *)&m->lij_callid, cx);
3471 ret |= uni_check_ie(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&m->lij_seqno, cx);
3472 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
3478 encode_leaf_setup_req(struct uni_msg *msg, struct uni_leaf_setup_req *p, struct unicx *cx)
3483 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_LEAF_SETUP_REQ, cx, &mlen))
3486 for(i = 0; i < UNI_NUM_IE_TNS; i++)
3487 if((p->tns[i].h.present & UNI_IE_PRESENT) &&
3488 uni_encode_ie(UNI_IE_TNS, msg, (union uni_ieall *)&p->tns[i], cx))
3489 return ((i << 16) + UNI_IE_TNS);
3490 if((p->calling.h.present & UNI_IE_PRESENT) &&
3491 uni_encode_ie(UNI_IE_CALLING, msg, (union uni_ieall *)&p->calling, cx))
3492 return (UNI_IE_CALLING);
3493 for(i = 0; i < UNI_NUM_IE_CALLINGSUB; i++)
3494 if((p->callingsub[i].h.present & UNI_IE_PRESENT) &&
3495 uni_encode_ie(UNI_IE_CALLINGSUB, msg, (union uni_ieall *)&p->callingsub[i], cx))
3496 return ((i << 16) + UNI_IE_CALLINGSUB);
3497 if((p->called.h.present & UNI_IE_PRESENT) &&
3498 uni_encode_ie(UNI_IE_CALLED, msg, (union uni_ieall *)&p->called, cx))
3499 return (UNI_IE_CALLED);
3500 for(i = 0; i < UNI_NUM_IE_CALLEDSUB; i++)
3501 if((p->calledsub[i].h.present & UNI_IE_PRESENT) &&
3502 uni_encode_ie(UNI_IE_CALLEDSUB, msg, (union uni_ieall *)&p->calledsub[i], cx))
3503 return ((i << 16) + UNI_IE_CALLEDSUB);
3504 if((p->lij_callid.h.present & UNI_IE_PRESENT) &&
3505 uni_encode_ie(UNI_IE_LIJ_CALLID, msg, (union uni_ieall *)&p->lij_callid, cx))
3506 return (UNI_IE_LIJ_CALLID);
3507 if((p->lij_seqno.h.present & UNI_IE_PRESENT) &&
3508 uni_encode_ie(UNI_IE_LIJ_SEQNO, msg, (union uni_ieall *)&p->lij_seqno, cx))
3509 return (UNI_IE_LIJ_SEQNO);
3510 if((p->unrec.h.present & UNI_IE_PRESENT) &&
3511 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
3512 return (UNI_IE_UNREC);
3514 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
3515 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
3521 decode_leaf_setup_req(struct uni_leaf_setup_req *out, struct uni_msg *msg,
3522 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
3530 for(i = 0; i < UNI_NUM_IE_TNS; i++)
3531 if (!IE_ISPRESENT(out->tns[i])) {
3532 out->tns[i].h = *hdr;
3533 if (hdr->present & UNI_IE_ERROR)
3535 if(uni_decode_ie_body(UNI_IE_TNS, (union uni_ieall *)&out->tns[i], msg, ielen, cx))
3541 case UNI_IE_CALLING:
3542 out->calling.h = *hdr;
3543 if (hdr->present & UNI_IE_ERROR)
3545 if(uni_decode_ie_body(UNI_IE_CALLING, (union uni_ieall *)&out->calling, msg, ielen, cx))
3549 case UNI_IE_CALLINGSUB:
3550 for(i = 0; i < UNI_NUM_IE_CALLINGSUB; i++)
3551 if (!IE_ISPRESENT(out->callingsub[i])) {
3552 out->callingsub[i].h = *hdr;
3553 if (hdr->present & UNI_IE_ERROR)
3555 if(uni_decode_ie_body(UNI_IE_CALLINGSUB, (union uni_ieall *)&out->callingsub[i], msg, ielen, cx))
3562 out->called.h = *hdr;
3563 if (hdr->present & UNI_IE_ERROR)
3565 if(uni_decode_ie_body(UNI_IE_CALLED, (union uni_ieall *)&out->called, msg, ielen, cx))
3569 case UNI_IE_CALLEDSUB:
3570 for(i = 0; i < UNI_NUM_IE_CALLEDSUB; i++)
3571 if (!IE_ISPRESENT(out->calledsub[i])) {
3572 out->calledsub[i].h = *hdr;
3573 if (hdr->present & UNI_IE_ERROR)
3575 if(uni_decode_ie_body(UNI_IE_CALLEDSUB, (union uni_ieall *)&out->calledsub[i], msg, ielen, cx))
3581 case UNI_IE_LIJ_CALLID:
3582 out->lij_callid.h = *hdr;
3583 if (hdr->present & UNI_IE_ERROR)
3585 if(uni_decode_ie_body(UNI_IE_LIJ_CALLID, (union uni_ieall *)&out->lij_callid, msg, ielen, cx))
3589 case UNI_IE_LIJ_SEQNO:
3590 out->lij_seqno.h = *hdr;
3591 if (hdr->present & UNI_IE_ERROR)
3593 if(uni_decode_ie_body(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&out->lij_seqno, msg, ielen, cx))
3598 out->unrec.h = *hdr;
3599 if (hdr->present & UNI_IE_ERROR)
3601 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
3611 static const struct msgdecl decl_leaf_setup_req = {
3614 (uni_msg_print_f)print_leaf_setup_req,
3615 (uni_msg_check_f)check_leaf_setup_req,
3616 (uni_msg_encode_f)encode_leaf_setup_req,
3617 (uni_msg_decode_f)decode_leaf_setup_req
3621 print_leaf_setup_fail(struct uni_leaf_setup_fail *msg, struct unicx *cx)
3625 if(msg->cause.h.present & UNI_IE_PRESENT)
3626 uni_print_ie_internal(UNI_IE_CAUSE, (union uni_ieall *)&msg->cause, cx);
3627 if(msg->called.h.present & UNI_IE_PRESENT)
3628 uni_print_ie_internal(UNI_IE_CALLED, (union uni_ieall *)&msg->called, cx);
3629 if(msg->calledsub.h.present & UNI_IE_PRESENT)
3630 uni_print_ie_internal(UNI_IE_CALLEDSUB, (union uni_ieall *)&msg->calledsub, cx);
3631 if(msg->lij_seqno.h.present & UNI_IE_PRESENT)
3632 uni_print_ie_internal(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&msg->lij_seqno, cx);
3633 for(i = 0; i < UNI_NUM_IE_TNS; i++)
3634 if(msg->tns[i].h.present & UNI_IE_PRESENT)
3635 uni_print_ie_internal(UNI_IE_TNS, (union uni_ieall *)&msg->tns[i], cx);
3636 if(msg->unrec.h.present & UNI_IE_PRESENT)
3637 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
3641 check_leaf_setup_fail(struct uni_leaf_setup_fail *m, struct unicx *cx)
3646 ret |= uni_check_ie(UNI_IE_CAUSE, (union uni_ieall *)&m->cause, cx);
3647 ret |= uni_check_ie(UNI_IE_CALLED, (union uni_ieall *)&m->called, cx);
3648 ret |= uni_check_ie(UNI_IE_CALLEDSUB, (union uni_ieall *)&m->calledsub, cx);
3649 ret |= uni_check_ie(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&m->lij_seqno, cx);
3650 for(i = 0; i < UNI_NUM_IE_TNS ; i++) {
3651 ret |= uni_check_ie(UNI_IE_TNS, (union uni_ieall *)&m->tns[i], cx);
3653 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
3659 encode_leaf_setup_fail(struct uni_msg *msg, struct uni_leaf_setup_fail *p, struct unicx *cx)
3664 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_LEAF_SETUP_FAIL, cx, &mlen))
3667 if((p->cause.h.present & UNI_IE_PRESENT) &&
3668 uni_encode_ie(UNI_IE_CAUSE, msg, (union uni_ieall *)&p->cause, cx))
3669 return (UNI_IE_CAUSE);
3670 if((p->called.h.present & UNI_IE_PRESENT) &&
3671 uni_encode_ie(UNI_IE_CALLED, msg, (union uni_ieall *)&p->called, cx))
3672 return (UNI_IE_CALLED);
3673 if((p->calledsub.h.present & UNI_IE_PRESENT) &&
3674 uni_encode_ie(UNI_IE_CALLEDSUB, msg, (union uni_ieall *)&p->calledsub, cx))
3675 return (UNI_IE_CALLEDSUB);
3676 if((p->lij_seqno.h.present & UNI_IE_PRESENT) &&
3677 uni_encode_ie(UNI_IE_LIJ_SEQNO, msg, (union uni_ieall *)&p->lij_seqno, cx))
3678 return (UNI_IE_LIJ_SEQNO);
3679 for(i = 0; i < UNI_NUM_IE_TNS; i++)
3680 if((p->tns[i].h.present & UNI_IE_PRESENT) &&
3681 uni_encode_ie(UNI_IE_TNS, msg, (union uni_ieall *)&p->tns[i], cx))
3682 return ((i << 16) + UNI_IE_TNS);
3683 if((p->unrec.h.present & UNI_IE_PRESENT) &&
3684 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
3685 return (UNI_IE_UNREC);
3687 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
3688 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
3694 decode_leaf_setup_fail(struct uni_leaf_setup_fail *out, struct uni_msg *msg,
3695 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
3703 out->cause.h = *hdr;
3704 if (hdr->present & UNI_IE_ERROR)
3706 if(uni_decode_ie_body(UNI_IE_CAUSE, (union uni_ieall *)&out->cause, msg, ielen, cx))
3711 out->called.h = *hdr;
3712 if (hdr->present & UNI_IE_ERROR)
3714 if(uni_decode_ie_body(UNI_IE_CALLED, (union uni_ieall *)&out->called, msg, ielen, cx))
3718 case UNI_IE_CALLEDSUB:
3719 out->calledsub.h = *hdr;
3720 if (hdr->present & UNI_IE_ERROR)
3722 if(uni_decode_ie_body(UNI_IE_CALLEDSUB, (union uni_ieall *)&out->calledsub, msg, ielen, cx))
3726 case UNI_IE_LIJ_SEQNO:
3727 out->lij_seqno.h = *hdr;
3728 if (hdr->present & UNI_IE_ERROR)
3730 if(uni_decode_ie_body(UNI_IE_LIJ_SEQNO, (union uni_ieall *)&out->lij_seqno, msg, ielen, cx))
3735 for(i = 0; i < UNI_NUM_IE_TNS; i++)
3736 if (!IE_ISPRESENT(out->tns[i])) {
3737 out->tns[i].h = *hdr;
3738 if (hdr->present & UNI_IE_ERROR)
3740 if(uni_decode_ie_body(UNI_IE_TNS, (union uni_ieall *)&out->tns[i], msg, ielen, cx))
3747 out->unrec.h = *hdr;
3748 if (hdr->present & UNI_IE_ERROR)
3750 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
3760 static const struct msgdecl decl_leaf_setup_fail = {
3763 (uni_msg_print_f)print_leaf_setup_fail,
3764 (uni_msg_check_f)check_leaf_setup_fail,
3765 (uni_msg_encode_f)encode_leaf_setup_fail,
3766 (uni_msg_decode_f)decode_leaf_setup_fail
3770 print_cobisetup(struct uni_cobisetup *msg, struct unicx *cx)
3772 if(msg->facility.h.present & UNI_IE_PRESENT)
3773 uni_print_ie_internal(UNI_IE_FACILITY, (union uni_ieall *)&msg->facility, cx);
3774 if(msg->called.h.present & UNI_IE_PRESENT)
3775 uni_print_ie_internal(UNI_IE_CALLED, (union uni_ieall *)&msg->called, cx);
3776 if(msg->calledsub.h.present & UNI_IE_PRESENT)
3777 uni_print_ie_internal(UNI_IE_CALLEDSUB, (union uni_ieall *)&msg->calledsub, cx);
3778 if(msg->calling.h.present & UNI_IE_PRESENT)
3779 uni_print_ie_internal(UNI_IE_CALLING, (union uni_ieall *)&msg->calling, cx);
3780 if(msg->notify.h.present & UNI_IE_PRESENT)
3781 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
3782 if(msg->unrec.h.present & UNI_IE_PRESENT)
3783 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
3787 check_cobisetup(struct uni_cobisetup *m, struct unicx *cx)
3791 ret |= uni_check_ie(UNI_IE_FACILITY, (union uni_ieall *)&m->facility, cx);
3792 ret |= uni_check_ie(UNI_IE_CALLED, (union uni_ieall *)&m->called, cx);
3793 ret |= uni_check_ie(UNI_IE_CALLEDSUB, (union uni_ieall *)&m->calledsub, cx);
3794 ret |= uni_check_ie(UNI_IE_CALLING, (union uni_ieall *)&m->calling, cx);
3795 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
3796 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
3802 encode_cobisetup(struct uni_msg *msg, struct uni_cobisetup *p, struct unicx *cx)
3806 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_COBISETUP, cx, &mlen))
3809 if((p->facility.h.present & UNI_IE_PRESENT) &&
3810 uni_encode_ie(UNI_IE_FACILITY, msg, (union uni_ieall *)&p->facility, cx))
3811 return (UNI_IE_FACILITY);
3812 if((p->called.h.present & UNI_IE_PRESENT) &&
3813 uni_encode_ie(UNI_IE_CALLED, msg, (union uni_ieall *)&p->called, cx))
3814 return (UNI_IE_CALLED);
3815 if((p->calledsub.h.present & UNI_IE_PRESENT) &&
3816 uni_encode_ie(UNI_IE_CALLEDSUB, msg, (union uni_ieall *)&p->calledsub, cx))
3817 return (UNI_IE_CALLEDSUB);
3818 if((p->calling.h.present & UNI_IE_PRESENT) &&
3819 uni_encode_ie(UNI_IE_CALLING, msg, (union uni_ieall *)&p->calling, cx))
3820 return (UNI_IE_CALLING);
3821 if((p->notify.h.present & UNI_IE_PRESENT) &&
3822 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
3823 return (UNI_IE_NOTIFY);
3824 if((p->unrec.h.present & UNI_IE_PRESENT) &&
3825 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
3826 return (UNI_IE_UNREC);
3828 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
3829 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
3835 decode_cobisetup(struct uni_cobisetup *out, struct uni_msg *msg,
3836 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
3841 case UNI_IE_FACILITY:
3842 out->facility.h = *hdr;
3843 if (hdr->present & UNI_IE_ERROR)
3845 if(uni_decode_ie_body(UNI_IE_FACILITY, (union uni_ieall *)&out->facility, msg, ielen, cx))
3850 out->called.h = *hdr;
3851 if (hdr->present & UNI_IE_ERROR)
3853 if(uni_decode_ie_body(UNI_IE_CALLED, (union uni_ieall *)&out->called, msg, ielen, cx))
3857 case UNI_IE_CALLEDSUB:
3858 out->calledsub.h = *hdr;
3859 if (hdr->present & UNI_IE_ERROR)
3861 if(uni_decode_ie_body(UNI_IE_CALLEDSUB, (union uni_ieall *)&out->calledsub, msg, ielen, cx))
3865 case UNI_IE_CALLING:
3866 out->calling.h = *hdr;
3867 if (hdr->present & UNI_IE_ERROR)
3869 if(uni_decode_ie_body(UNI_IE_CALLING, (union uni_ieall *)&out->calling, msg, ielen, cx))
3874 out->notify.h = *hdr;
3875 if (hdr->present & UNI_IE_ERROR)
3877 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
3882 out->unrec.h = *hdr;
3883 if (hdr->present & UNI_IE_ERROR)
3885 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
3895 static const struct msgdecl decl_cobisetup = {
3898 (uni_msg_print_f)print_cobisetup,
3899 (uni_msg_check_f)check_cobisetup,
3900 (uni_msg_encode_f)encode_cobisetup,
3901 (uni_msg_decode_f)decode_cobisetup
3905 print_facility(struct uni_facility *msg, struct unicx *cx)
3907 if(msg->facility.h.present & UNI_IE_PRESENT)
3908 uni_print_ie_internal(UNI_IE_FACILITY, (union uni_ieall *)&msg->facility, cx);
3909 if(msg->called.h.present & UNI_IE_PRESENT)
3910 uni_print_ie_internal(UNI_IE_CALLED, (union uni_ieall *)&msg->called, cx);
3911 if(msg->calledsub.h.present & UNI_IE_PRESENT)
3912 uni_print_ie_internal(UNI_IE_CALLEDSUB, (union uni_ieall *)&msg->calledsub, cx);
3913 if(msg->calling.h.present & UNI_IE_PRESENT)
3914 uni_print_ie_internal(UNI_IE_CALLING, (union uni_ieall *)&msg->calling, cx);
3915 if(msg->notify.h.present & UNI_IE_PRESENT)
3916 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
3917 if(msg->unrec.h.present & UNI_IE_PRESENT)
3918 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
3922 check_facility(struct uni_facility *m, struct unicx *cx)
3926 ret |= uni_check_ie(UNI_IE_FACILITY, (union uni_ieall *)&m->facility, cx);
3927 ret |= uni_check_ie(UNI_IE_CALLED, (union uni_ieall *)&m->called, cx);
3928 ret |= uni_check_ie(UNI_IE_CALLEDSUB, (union uni_ieall *)&m->calledsub, cx);
3929 ret |= uni_check_ie(UNI_IE_CALLING, (union uni_ieall *)&m->calling, cx);
3930 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
3931 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
3937 encode_facility(struct uni_msg *msg, struct uni_facility *p, struct unicx *cx)
3941 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_FACILITY, cx, &mlen))
3944 if((p->facility.h.present & UNI_IE_PRESENT) &&
3945 uni_encode_ie(UNI_IE_FACILITY, msg, (union uni_ieall *)&p->facility, cx))
3946 return (UNI_IE_FACILITY);
3947 if((p->called.h.present & UNI_IE_PRESENT) &&
3948 uni_encode_ie(UNI_IE_CALLED, msg, (union uni_ieall *)&p->called, cx))
3949 return (UNI_IE_CALLED);
3950 if((p->calledsub.h.present & UNI_IE_PRESENT) &&
3951 uni_encode_ie(UNI_IE_CALLEDSUB, msg, (union uni_ieall *)&p->calledsub, cx))
3952 return (UNI_IE_CALLEDSUB);
3953 if((p->calling.h.present & UNI_IE_PRESENT) &&
3954 uni_encode_ie(UNI_IE_CALLING, msg, (union uni_ieall *)&p->calling, cx))
3955 return (UNI_IE_CALLING);
3956 if((p->notify.h.present & UNI_IE_PRESENT) &&
3957 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
3958 return (UNI_IE_NOTIFY);
3959 if((p->unrec.h.present & UNI_IE_PRESENT) &&
3960 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
3961 return (UNI_IE_UNREC);
3963 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
3964 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
3970 decode_facility(struct uni_facility *out, struct uni_msg *msg,
3971 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
3976 case UNI_IE_FACILITY:
3977 out->facility.h = *hdr;
3978 if (hdr->present & UNI_IE_ERROR)
3980 if(uni_decode_ie_body(UNI_IE_FACILITY, (union uni_ieall *)&out->facility, msg, ielen, cx))
3985 out->called.h = *hdr;
3986 if (hdr->present & UNI_IE_ERROR)
3988 if(uni_decode_ie_body(UNI_IE_CALLED, (union uni_ieall *)&out->called, msg, ielen, cx))
3992 case UNI_IE_CALLEDSUB:
3993 out->calledsub.h = *hdr;
3994 if (hdr->present & UNI_IE_ERROR)
3996 if(uni_decode_ie_body(UNI_IE_CALLEDSUB, (union uni_ieall *)&out->calledsub, msg, ielen, cx))
4000 case UNI_IE_CALLING:
4001 out->calling.h = *hdr;
4002 if (hdr->present & UNI_IE_ERROR)
4004 if(uni_decode_ie_body(UNI_IE_CALLING, (union uni_ieall *)&out->calling, msg, ielen, cx))
4009 out->notify.h = *hdr;
4010 if (hdr->present & UNI_IE_ERROR)
4012 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
4017 out->unrec.h = *hdr;
4018 if (hdr->present & UNI_IE_ERROR)
4020 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
4030 static const struct msgdecl decl_facility = {
4033 (uni_msg_print_f)print_facility,
4034 (uni_msg_check_f)check_facility,
4035 (uni_msg_encode_f)encode_facility,
4036 (uni_msg_decode_f)decode_facility
4040 print_modify_req(struct uni_modify_req *msg, struct unicx *cx)
4044 if(msg->traffic.h.present & UNI_IE_PRESENT)
4045 uni_print_ie_internal(UNI_IE_TRAFFIC, (union uni_ieall *)&msg->traffic, cx);
4046 if(msg->atraffic.h.present & UNI_IE_PRESENT)
4047 uni_print_ie_internal(UNI_IE_ATRAFFIC, (union uni_ieall *)&msg->atraffic, cx);
4048 if(msg->mintraffic.h.present & UNI_IE_PRESENT)
4049 uni_print_ie_internal(UNI_IE_MINTRAFFIC, (union uni_ieall *)&msg->mintraffic, cx);
4050 if(msg->notify.h.present & UNI_IE_PRESENT)
4051 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
4052 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4053 if(msg->git[i].h.present & UNI_IE_PRESENT)
4054 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
4055 if(msg->unrec.h.present & UNI_IE_PRESENT)
4056 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
4060 check_modify_req(struct uni_modify_req *m, struct unicx *cx)
4065 ret |= uni_check_ie(UNI_IE_TRAFFIC, (union uni_ieall *)&m->traffic, cx);
4066 ret |= uni_check_ie(UNI_IE_ATRAFFIC, (union uni_ieall *)&m->atraffic, cx);
4067 ret |= uni_check_ie(UNI_IE_MINTRAFFIC, (union uni_ieall *)&m->mintraffic, cx);
4068 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
4069 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
4070 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
4072 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
4078 encode_modify_req(struct uni_msg *msg, struct uni_modify_req *p, struct unicx *cx)
4083 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_MODIFY_REQ, cx, &mlen))
4086 if((p->traffic.h.present & UNI_IE_PRESENT) &&
4087 uni_encode_ie(UNI_IE_TRAFFIC, msg, (union uni_ieall *)&p->traffic, cx))
4088 return (UNI_IE_TRAFFIC);
4089 if((p->atraffic.h.present & UNI_IE_PRESENT) &&
4090 uni_encode_ie(UNI_IE_ATRAFFIC, msg, (union uni_ieall *)&p->atraffic, cx))
4091 return (UNI_IE_ATRAFFIC);
4092 if((p->mintraffic.h.present & UNI_IE_PRESENT) &&
4093 uni_encode_ie(UNI_IE_MINTRAFFIC, msg, (union uni_ieall *)&p->mintraffic, cx))
4094 return (UNI_IE_MINTRAFFIC);
4095 if((p->notify.h.present & UNI_IE_PRESENT) &&
4096 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
4097 return (UNI_IE_NOTIFY);
4098 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4099 if((p->git[i].h.present & UNI_IE_PRESENT) &&
4100 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
4101 return ((i << 16) + UNI_IE_GIT);
4102 if((p->unrec.h.present & UNI_IE_PRESENT) &&
4103 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
4104 return (UNI_IE_UNREC);
4106 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
4107 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
4113 decode_modify_req(struct uni_modify_req *out, struct uni_msg *msg,
4114 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
4121 case UNI_IE_TRAFFIC:
4122 out->traffic.h = *hdr;
4123 if (hdr->present & UNI_IE_ERROR)
4125 if(uni_decode_ie_body(UNI_IE_TRAFFIC, (union uni_ieall *)&out->traffic, msg, ielen, cx))
4129 case UNI_IE_ATRAFFIC:
4130 out->atraffic.h = *hdr;
4131 if (hdr->present & UNI_IE_ERROR)
4133 if(uni_decode_ie_body(UNI_IE_ATRAFFIC, (union uni_ieall *)&out->atraffic, msg, ielen, cx))
4137 case UNI_IE_MINTRAFFIC:
4138 out->mintraffic.h = *hdr;
4139 if (hdr->present & UNI_IE_ERROR)
4141 if(uni_decode_ie_body(UNI_IE_MINTRAFFIC, (union uni_ieall *)&out->mintraffic, msg, ielen, cx))
4146 out->notify.h = *hdr;
4147 if (hdr->present & UNI_IE_ERROR)
4149 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
4154 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4155 if (!IE_ISPRESENT(out->git[i])) {
4156 out->git[i].h = *hdr;
4157 if (hdr->present & UNI_IE_ERROR)
4159 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
4166 out->unrec.h = *hdr;
4167 if (hdr->present & UNI_IE_ERROR)
4169 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
4179 static const struct msgdecl decl_modify_req = {
4182 (uni_msg_print_f)print_modify_req,
4183 (uni_msg_check_f)check_modify_req,
4184 (uni_msg_encode_f)encode_modify_req,
4185 (uni_msg_decode_f)decode_modify_req
4189 print_modify_ack(struct uni_modify_ack *msg, struct unicx *cx)
4193 if(msg->report.h.present & UNI_IE_PRESENT)
4194 uni_print_ie_internal(UNI_IE_REPORT, (union uni_ieall *)&msg->report, cx);
4195 if(msg->traffic.h.present & UNI_IE_PRESENT)
4196 uni_print_ie_internal(UNI_IE_TRAFFIC, (union uni_ieall *)&msg->traffic, cx);
4197 if(msg->notify.h.present & UNI_IE_PRESENT)
4198 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
4199 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4200 if(msg->git[i].h.present & UNI_IE_PRESENT)
4201 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
4202 if(msg->unrec.h.present & UNI_IE_PRESENT)
4203 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
4207 check_modify_ack(struct uni_modify_ack *m, struct unicx *cx)
4212 ret |= uni_check_ie(UNI_IE_REPORT, (union uni_ieall *)&m->report, cx);
4213 ret |= uni_check_ie(UNI_IE_TRAFFIC, (union uni_ieall *)&m->traffic, cx);
4214 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
4215 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
4216 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
4218 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
4224 encode_modify_ack(struct uni_msg *msg, struct uni_modify_ack *p, struct unicx *cx)
4229 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_MODIFY_ACK, cx, &mlen))
4232 if((p->report.h.present & UNI_IE_PRESENT) &&
4233 uni_encode_ie(UNI_IE_REPORT, msg, (union uni_ieall *)&p->report, cx))
4234 return (UNI_IE_REPORT);
4235 if((p->traffic.h.present & UNI_IE_PRESENT) &&
4236 uni_encode_ie(UNI_IE_TRAFFIC, msg, (union uni_ieall *)&p->traffic, cx))
4237 return (UNI_IE_TRAFFIC);
4238 if((p->notify.h.present & UNI_IE_PRESENT) &&
4239 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
4240 return (UNI_IE_NOTIFY);
4241 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4242 if((p->git[i].h.present & UNI_IE_PRESENT) &&
4243 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
4244 return ((i << 16) + UNI_IE_GIT);
4245 if((p->unrec.h.present & UNI_IE_PRESENT) &&
4246 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
4247 return (UNI_IE_UNREC);
4249 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
4250 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
4256 decode_modify_ack(struct uni_modify_ack *out, struct uni_msg *msg,
4257 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
4265 out->report.h = *hdr;
4266 if (hdr->present & UNI_IE_ERROR)
4268 if(uni_decode_ie_body(UNI_IE_REPORT, (union uni_ieall *)&out->report, msg, ielen, cx))
4272 case UNI_IE_TRAFFIC:
4273 out->traffic.h = *hdr;
4274 if (hdr->present & UNI_IE_ERROR)
4276 if(uni_decode_ie_body(UNI_IE_TRAFFIC, (union uni_ieall *)&out->traffic, msg, ielen, cx))
4281 out->notify.h = *hdr;
4282 if (hdr->present & UNI_IE_ERROR)
4284 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
4289 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4290 if (!IE_ISPRESENT(out->git[i])) {
4291 out->git[i].h = *hdr;
4292 if (hdr->present & UNI_IE_ERROR)
4294 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
4301 out->unrec.h = *hdr;
4302 if (hdr->present & UNI_IE_ERROR)
4304 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
4314 static const struct msgdecl decl_modify_ack = {
4317 (uni_msg_print_f)print_modify_ack,
4318 (uni_msg_check_f)check_modify_ack,
4319 (uni_msg_encode_f)encode_modify_ack,
4320 (uni_msg_decode_f)decode_modify_ack
4324 print_modify_rej(struct uni_modify_rej *msg, struct unicx *cx)
4328 if(msg->cause.h.present & UNI_IE_PRESENT)
4329 uni_print_ie_internal(UNI_IE_CAUSE, (union uni_ieall *)&msg->cause, cx);
4330 if(msg->notify.h.present & UNI_IE_PRESENT)
4331 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
4332 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4333 if(msg->git[i].h.present & UNI_IE_PRESENT)
4334 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
4335 if(msg->unrec.h.present & UNI_IE_PRESENT)
4336 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
4340 check_modify_rej(struct uni_modify_rej *m, struct unicx *cx)
4345 ret |= uni_check_ie(UNI_IE_CAUSE, (union uni_ieall *)&m->cause, cx);
4346 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
4347 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
4348 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
4350 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
4356 encode_modify_rej(struct uni_msg *msg, struct uni_modify_rej *p, struct unicx *cx)
4361 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_MODIFY_REJ, cx, &mlen))
4364 if((p->cause.h.present & UNI_IE_PRESENT) &&
4365 uni_encode_ie(UNI_IE_CAUSE, msg, (union uni_ieall *)&p->cause, cx))
4366 return (UNI_IE_CAUSE);
4367 if((p->notify.h.present & UNI_IE_PRESENT) &&
4368 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
4369 return (UNI_IE_NOTIFY);
4370 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4371 if((p->git[i].h.present & UNI_IE_PRESENT) &&
4372 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
4373 return ((i << 16) + UNI_IE_GIT);
4374 if((p->unrec.h.present & UNI_IE_PRESENT) &&
4375 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
4376 return (UNI_IE_UNREC);
4378 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
4379 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
4385 decode_modify_rej(struct uni_modify_rej *out, struct uni_msg *msg,
4386 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
4394 out->cause.h = *hdr;
4395 if (hdr->present & UNI_IE_ERROR)
4397 if(uni_decode_ie_body(UNI_IE_CAUSE, (union uni_ieall *)&out->cause, msg, ielen, cx))
4402 out->notify.h = *hdr;
4403 if (hdr->present & UNI_IE_ERROR)
4405 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
4410 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4411 if (!IE_ISPRESENT(out->git[i])) {
4412 out->git[i].h = *hdr;
4413 if (hdr->present & UNI_IE_ERROR)
4415 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
4422 out->unrec.h = *hdr;
4423 if (hdr->present & UNI_IE_ERROR)
4425 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
4435 static const struct msgdecl decl_modify_rej = {
4438 (uni_msg_print_f)print_modify_rej,
4439 (uni_msg_check_f)check_modify_rej,
4440 (uni_msg_encode_f)encode_modify_rej,
4441 (uni_msg_decode_f)decode_modify_rej
4445 print_conn_avail(struct uni_conn_avail *msg, struct unicx *cx)
4449 if(msg->notify.h.present & UNI_IE_PRESENT)
4450 uni_print_ie_internal(UNI_IE_NOTIFY, (union uni_ieall *)&msg->notify, cx);
4451 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4452 if(msg->git[i].h.present & UNI_IE_PRESENT)
4453 uni_print_ie_internal(UNI_IE_GIT, (union uni_ieall *)&msg->git[i], cx);
4454 if(msg->report.h.present & UNI_IE_PRESENT)
4455 uni_print_ie_internal(UNI_IE_REPORT, (union uni_ieall *)&msg->report, cx);
4456 if(msg->unrec.h.present & UNI_IE_PRESENT)
4457 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
4461 check_conn_avail(struct uni_conn_avail *m, struct unicx *cx)
4466 ret |= uni_check_ie(UNI_IE_NOTIFY, (union uni_ieall *)&m->notify, cx);
4467 for(i = 0; i < UNI_NUM_IE_GIT ; i++) {
4468 ret |= uni_check_ie(UNI_IE_GIT, (union uni_ieall *)&m->git[i], cx);
4470 ret |= uni_check_ie(UNI_IE_REPORT, (union uni_ieall *)&m->report, cx);
4471 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
4477 encode_conn_avail(struct uni_msg *msg, struct uni_conn_avail *p, struct unicx *cx)
4482 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_CONN_AVAIL, cx, &mlen))
4485 if((p->notify.h.present & UNI_IE_PRESENT) &&
4486 uni_encode_ie(UNI_IE_NOTIFY, msg, (union uni_ieall *)&p->notify, cx))
4487 return (UNI_IE_NOTIFY);
4488 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4489 if((p->git[i].h.present & UNI_IE_PRESENT) &&
4490 uni_encode_ie(UNI_IE_GIT, msg, (union uni_ieall *)&p->git[i], cx))
4491 return ((i << 16) + UNI_IE_GIT);
4492 if((p->report.h.present & UNI_IE_PRESENT) &&
4493 uni_encode_ie(UNI_IE_REPORT, msg, (union uni_ieall *)&p->report, cx))
4494 return (UNI_IE_REPORT);
4495 if((p->unrec.h.present & UNI_IE_PRESENT) &&
4496 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
4497 return (UNI_IE_UNREC);
4499 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
4500 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
4506 decode_conn_avail(struct uni_conn_avail *out, struct uni_msg *msg,
4507 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
4515 out->notify.h = *hdr;
4516 if (hdr->present & UNI_IE_ERROR)
4518 if(uni_decode_ie_body(UNI_IE_NOTIFY, (union uni_ieall *)&out->notify, msg, ielen, cx))
4523 for(i = 0; i < UNI_NUM_IE_GIT; i++)
4524 if (!IE_ISPRESENT(out->git[i])) {
4525 out->git[i].h = *hdr;
4526 if (hdr->present & UNI_IE_ERROR)
4528 if(uni_decode_ie_body(UNI_IE_GIT, (union uni_ieall *)&out->git[i], msg, ielen, cx))
4535 out->report.h = *hdr;
4536 if (hdr->present & UNI_IE_ERROR)
4538 if(uni_decode_ie_body(UNI_IE_REPORT, (union uni_ieall *)&out->report, msg, ielen, cx))
4543 out->unrec.h = *hdr;
4544 if (hdr->present & UNI_IE_ERROR)
4546 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
4556 static const struct msgdecl decl_conn_avail = {
4559 (uni_msg_print_f)print_conn_avail,
4560 (uni_msg_check_f)check_conn_avail,
4561 (uni_msg_encode_f)encode_conn_avail,
4562 (uni_msg_decode_f)decode_conn_avail
4566 print_unknown(struct uni_unknown *msg, struct unicx *cx)
4568 if(msg->epref.h.present & UNI_IE_PRESENT)
4569 uni_print_ie_internal(UNI_IE_EPREF, (union uni_ieall *)&msg->epref, cx);
4570 if(msg->unrec.h.present & UNI_IE_PRESENT)
4571 uni_print_ie_internal(UNI_IE_UNREC, (union uni_ieall *)&msg->unrec, cx);
4575 check_unknown(struct uni_unknown *m, struct unicx *cx)
4579 ret |= uni_check_ie(UNI_IE_EPREF, (union uni_ieall *)&m->epref, cx);
4580 ret |= uni_check_ie(UNI_IE_UNREC, (union uni_ieall *)&m->unrec, cx);
4586 encode_unknown(struct uni_msg *msg, struct uni_unknown *p, struct unicx *cx)
4590 if(uni_encode_msg_hdr(msg, &p->hdr, UNI_UNKNOWN, cx, &mlen))
4593 if((p->epref.h.present & UNI_IE_PRESENT) &&
4594 uni_encode_ie(UNI_IE_EPREF, msg, (union uni_ieall *)&p->epref, cx))
4595 return (UNI_IE_EPREF);
4596 if((p->unrec.h.present & UNI_IE_PRESENT) &&
4597 uni_encode_ie(UNI_IE_UNREC, msg, (union uni_ieall *)&p->unrec, cx))
4598 return (UNI_IE_UNREC);
4600 msg->b_buf[mlen+0] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 8;
4601 msg->b_buf[mlen+1] = ((msg->b_wptr-msg->b_rptr)-mlen-2) >> 0;
4607 decode_unknown(struct uni_unknown *out, struct uni_msg *msg,
4608 enum uni_ietype ie, struct uni_iehdr *hdr, u_int ielen,
4614 out->epref.h = *hdr;
4615 if (hdr->present & UNI_IE_ERROR)
4617 if(uni_decode_ie_body(UNI_IE_EPREF, (union uni_ieall *)&out->epref, msg, ielen, cx))
4622 out->unrec.h = *hdr;
4623 if (hdr->present & UNI_IE_ERROR)
4625 if(uni_decode_ie_body(UNI_IE_UNREC, (union uni_ieall *)&out->unrec, msg, ielen, cx))
4635 static const struct msgdecl decl_unknown = {
4638 (uni_msg_print_f)print_unknown,
4639 (uni_msg_check_f)check_unknown,
4640 (uni_msg_encode_f)encode_unknown,
4641 (uni_msg_decode_f)decode_unknown
4644 const struct msgdecl *uni_msgtable[256] = {
4645 &decl_unknown, /* 0x00 */
4646 &decl_alerting, /* 0x01 */
4647 &decl_call_proc, /* 0x02 */
4648 &decl_unknown, /* 0x03 */
4649 &decl_unknown, /* 0x04 */
4650 &decl_setup, /* 0x05 */
4651 &decl_unknown, /* 0x06 */
4652 &decl_connect, /* 0x07 */
4653 &decl_unknown, /* 0x08 */
4654 &decl_unknown, /* 0x09 */
4655 &decl_unknown, /* 0x0a */
4656 &decl_unknown, /* 0x0b */
4657 &decl_unknown, /* 0x0c */
4658 &decl_unknown, /* 0x0d */
4659 &decl_unknown, /* 0x0e */
4660 &decl_connect_ack, /* 0x0f */
4661 &decl_unknown, /* 0x10 */
4662 &decl_unknown, /* 0x11 */
4663 &decl_unknown, /* 0x12 */
4664 &decl_unknown, /* 0x13 */
4665 &decl_unknown, /* 0x14 */
4666 &decl_cobisetup, /* 0x15 */
4667 &decl_unknown, /* 0x16 */
4668 &decl_unknown, /* 0x17 */
4669 &decl_unknown, /* 0x18 */
4670 &decl_unknown, /* 0x19 */
4671 &decl_unknown, /* 0x1a */
4672 &decl_unknown, /* 0x1b */
4673 &decl_unknown, /* 0x1c */
4674 &decl_unknown, /* 0x1d */
4675 &decl_unknown, /* 0x1e */
4676 &decl_unknown, /* 0x1f */
4677 &decl_unknown, /* 0x20 */
4678 &decl_unknown, /* 0x21 */
4679 &decl_unknown, /* 0x22 */
4680 &decl_unknown, /* 0x23 */
4681 &decl_unknown, /* 0x24 */
4682 &decl_unknown, /* 0x25 */
4683 &decl_unknown, /* 0x26 */
4684 &decl_unknown, /* 0x27 */
4685 &decl_unknown, /* 0x28 */
4686 &decl_unknown, /* 0x29 */
4687 &decl_unknown, /* 0x2a */
4688 &decl_unknown, /* 0x2b */
4689 &decl_unknown, /* 0x2c */
4690 &decl_unknown, /* 0x2d */
4691 &decl_unknown, /* 0x2e */
4692 &decl_unknown, /* 0x2f */
4693 &decl_unknown, /* 0x30 */
4694 &decl_unknown, /* 0x31 */
4695 &decl_unknown, /* 0x32 */
4696 &decl_unknown, /* 0x33 */
4697 &decl_unknown, /* 0x34 */
4698 &decl_unknown, /* 0x35 */
4699 &decl_unknown, /* 0x36 */
4700 &decl_unknown, /* 0x37 */
4701 &decl_unknown, /* 0x38 */
4702 &decl_unknown, /* 0x39 */
4703 &decl_unknown, /* 0x3a */
4704 &decl_unknown, /* 0x3b */
4705 &decl_unknown, /* 0x3c */
4706 &decl_unknown, /* 0x3d */
4707 &decl_unknown, /* 0x3e */
4708 &decl_unknown, /* 0x3f */
4709 &decl_unknown, /* 0x40 */
4710 &decl_unknown, /* 0x41 */
4711 &decl_unknown, /* 0x42 */
4712 &decl_unknown, /* 0x43 */
4713 &decl_unknown, /* 0x44 */
4714 &decl_unknown, /* 0x45 */
4715 &decl_restart, /* 0x46 */
4716 &decl_unknown, /* 0x47 */
4717 &decl_unknown, /* 0x48 */
4718 &decl_unknown, /* 0x49 */
4719 &decl_unknown, /* 0x4a */
4720 &decl_unknown, /* 0x4b */
4721 &decl_unknown, /* 0x4c */
4722 &decl_release, /* 0x4d */
4723 &decl_restart_ack, /* 0x4e */
4724 &decl_unknown, /* 0x4f */
4725 &decl_unknown, /* 0x50 */
4726 &decl_unknown, /* 0x51 */
4727 &decl_unknown, /* 0x52 */
4728 &decl_unknown, /* 0x53 */
4729 &decl_unknown, /* 0x54 */
4730 &decl_unknown, /* 0x55 */
4731 &decl_unknown, /* 0x56 */
4732 &decl_unknown, /* 0x57 */
4733 &decl_unknown, /* 0x58 */
4734 &decl_unknown, /* 0x59 */
4735 &decl_release_compl, /* 0x5a */
4736 &decl_unknown, /* 0x5b */
4737 &decl_unknown, /* 0x5c */
4738 &decl_unknown, /* 0x5d */
4739 &decl_unknown, /* 0x5e */
4740 &decl_unknown, /* 0x5f */
4741 &decl_unknown, /* 0x60 */
4742 &decl_unknown, /* 0x61 */
4743 &decl_facility, /* 0x62 */
4744 &decl_unknown, /* 0x63 */
4745 &decl_unknown, /* 0x64 */
4746 &decl_unknown, /* 0x65 */
4747 &decl_unknown, /* 0x66 */
4748 &decl_unknown, /* 0x67 */
4749 &decl_unknown, /* 0x68 */
4750 &decl_unknown, /* 0x69 */
4751 &decl_unknown, /* 0x6a */
4752 &decl_unknown, /* 0x6b */
4753 &decl_unknown, /* 0x6c */
4754 &decl_unknown, /* 0x6d */
4755 &decl_notify, /* 0x6e */
4756 &decl_unknown, /* 0x6f */
4757 &decl_unknown, /* 0x70 */
4758 &decl_unknown, /* 0x71 */
4759 &decl_unknown, /* 0x72 */
4760 &decl_unknown, /* 0x73 */
4761 &decl_unknown, /* 0x74 */
4762 &decl_status_enq, /* 0x75 */
4763 &decl_unknown, /* 0x76 */
4764 &decl_unknown, /* 0x77 */
4765 &decl_unknown, /* 0x78 */
4766 &decl_unknown, /* 0x79 */
4767 &decl_unknown, /* 0x7a */
4768 &decl_unknown, /* 0x7b */
4769 &decl_unknown, /* 0x7c */
4770 &decl_status, /* 0x7d */
4771 &decl_unknown, /* 0x7e */
4772 &decl_unknown, /* 0x7f */
4773 &decl_add_party, /* 0x80 */
4774 &decl_add_party_ack, /* 0x81 */
4775 &decl_add_party_rej, /* 0x82 */
4776 &decl_drop_party, /* 0x83 */
4777 &decl_drop_party_ack, /* 0x84 */
4778 &decl_party_alerting, /* 0x85 */
4779 &decl_unknown, /* 0x86 */
4780 &decl_unknown, /* 0x87 */
4781 &decl_modify_req, /* 0x88 */
4782 &decl_modify_ack, /* 0x89 */
4783 &decl_modify_rej, /* 0x8a */
4784 &decl_conn_avail, /* 0x8b */
4785 &decl_unknown, /* 0x8c */
4786 &decl_unknown, /* 0x8d */
4787 &decl_unknown, /* 0x8e */
4788 &decl_unknown, /* 0x8f */
4789 &decl_leaf_setup_fail, /* 0x90 */
4790 &decl_leaf_setup_req, /* 0x91 */
4791 &decl_unknown, /* 0x92 */
4792 &decl_unknown, /* 0x93 */
4793 &decl_unknown, /* 0x94 */
4794 &decl_unknown, /* 0x95 */
4795 &decl_unknown, /* 0x96 */
4796 &decl_unknown, /* 0x97 */
4797 &decl_unknown, /* 0x98 */
4798 &decl_unknown, /* 0x99 */
4799 &decl_unknown, /* 0x9a */
4800 &decl_unknown, /* 0x9b */
4801 &decl_unknown, /* 0x9c */
4802 &decl_unknown, /* 0x9d */
4803 &decl_unknown, /* 0x9e */
4804 &decl_unknown, /* 0x9f */
4805 &decl_unknown, /* 0xa0 */
4806 &decl_unknown, /* 0xa1 */
4807 &decl_unknown, /* 0xa2 */
4808 &decl_unknown, /* 0xa3 */
4809 &decl_unknown, /* 0xa4 */
4810 &decl_unknown, /* 0xa5 */
4811 &decl_unknown, /* 0xa6 */
4812 &decl_unknown, /* 0xa7 */
4813 &decl_unknown, /* 0xa8 */
4814 &decl_unknown, /* 0xa9 */
4815 &decl_unknown, /* 0xaa */
4816 &decl_unknown, /* 0xab */
4817 &decl_unknown, /* 0xac */
4818 &decl_unknown, /* 0xad */
4819 &decl_unknown, /* 0xae */
4820 &decl_unknown, /* 0xaf */
4821 &decl_unknown, /* 0xb0 */
4822 &decl_unknown, /* 0xb1 */
4823 &decl_unknown, /* 0xb2 */
4824 &decl_unknown, /* 0xb3 */
4825 &decl_unknown, /* 0xb4 */
4826 &decl_unknown, /* 0xb5 */
4827 &decl_unknown, /* 0xb6 */
4828 &decl_unknown, /* 0xb7 */
4829 &decl_unknown, /* 0xb8 */
4830 &decl_unknown, /* 0xb9 */
4831 &decl_unknown, /* 0xba */
4832 &decl_unknown, /* 0xbb */
4833 &decl_unknown, /* 0xbc */
4834 &decl_unknown, /* 0xbd */
4835 &decl_unknown, /* 0xbe */
4836 &decl_unknown, /* 0xbf */
4837 &decl_unknown, /* 0xc0 */
4838 &decl_unknown, /* 0xc1 */
4839 &decl_unknown, /* 0xc2 */
4840 &decl_unknown, /* 0xc3 */
4841 &decl_unknown, /* 0xc4 */
4842 &decl_unknown, /* 0xc5 */
4843 &decl_unknown, /* 0xc6 */
4844 &decl_unknown, /* 0xc7 */
4845 &decl_unknown, /* 0xc8 */
4846 &decl_unknown, /* 0xc9 */
4847 &decl_unknown, /* 0xca */
4848 &decl_unknown, /* 0xcb */
4849 &decl_unknown, /* 0xcc */
4850 &decl_unknown, /* 0xcd */
4851 &decl_unknown, /* 0xce */
4852 &decl_unknown, /* 0xcf */
4853 &decl_unknown, /* 0xd0 */
4854 &decl_unknown, /* 0xd1 */
4855 &decl_unknown, /* 0xd2 */
4856 &decl_unknown, /* 0xd3 */
4857 &decl_unknown, /* 0xd4 */
4858 &decl_unknown, /* 0xd5 */
4859 &decl_unknown, /* 0xd6 */
4860 &decl_unknown, /* 0xd7 */
4861 &decl_unknown, /* 0xd8 */
4862 &decl_unknown, /* 0xd9 */
4863 &decl_unknown, /* 0xda */
4864 &decl_unknown, /* 0xdb */
4865 &decl_unknown, /* 0xdc */
4866 &decl_unknown, /* 0xdd */
4867 &decl_unknown, /* 0xde */
4868 &decl_unknown, /* 0xdf */
4869 &decl_unknown, /* 0xe0 */
4870 &decl_unknown, /* 0xe1 */
4871 &decl_unknown, /* 0xe2 */
4872 &decl_unknown, /* 0xe3 */
4873 &decl_unknown, /* 0xe4 */
4874 &decl_unknown, /* 0xe5 */
4875 &decl_unknown, /* 0xe6 */
4876 &decl_unknown, /* 0xe7 */
4877 &decl_unknown, /* 0xe8 */
4878 &decl_unknown, /* 0xe9 */
4879 &decl_unknown, /* 0xea */
4880 &decl_unknown, /* 0xeb */
4881 &decl_unknown, /* 0xec */
4882 &decl_unknown, /* 0xed */
4883 &decl_unknown, /* 0xee */
4884 &decl_unknown, /* 0xef */
4885 &decl_unknown, /* 0xf0 */
4886 &decl_unknown, /* 0xf1 */
4887 &decl_unknown, /* 0xf2 */
4888 &decl_unknown, /* 0xf3 */
4889 &decl_unknown, /* 0xf4 */
4890 &decl_unknown, /* 0xf5 */
4891 &decl_unknown, /* 0xf6 */
4892 &decl_unknown, /* 0xf7 */
4893 &decl_unknown, /* 0xf8 */
4894 &decl_unknown, /* 0xf9 */
4895 &decl_unknown, /* 0xfa */
4896 &decl_unknown, /* 0xfb */
4897 &decl_unknown, /* 0xfc */
4898 &decl_unknown, /* 0xfd */
4899 &decl_unknown, /* 0xfe */
4900 &decl_unknown, /* 0xff */