U8, U16, U32 data type changes
[o-du/l2.git] / src / cm / cm_tpt.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18 \f
19 /********************************************************************20**
20   
21      Name:     HCT Interface
22   
23      Type:     C file
24   
25      Desc:     This file contains the packing/unpacking functions
26                for the H.225 primitives on hct interface
27
28      File:     cm_tpt.c
29
30 *********************************************************************21*/
31 \f
32 /* header include files (.h) */
33
34 #include "envopt.h"        /* environment options */  
35 #include "envdep.h"        /* environment dependent */
36 #include "envind.h"        /* environment independent */
37
38 #include "gen.h"           /* general layer */
39 #include "ssi.h"           /* system service interface */
40
41 #include "cm_tpt.h"
42
43 /* header/extern include files (.x) */
44
45 #include "gen.x"           /* general layer */
46 #include "ssi.x"           /* system service interface */
47
48 /*#include "cm_tkns.x"*/
49 #include "cm_tpt.x"
50
51 \f
52 /* local defines */
53
54 /* local typedefs */
55
56 /* local externs */
57   
58 /* forward references */
59
60 /* local function definition */
61
62 /* functions in other modules */
63
64 /* public variable declarations */
65
66 /* control variables for testing */
67
68 /* private variable declarations */
69
70 /*
71  * support functions
72  */
73
74 /*  cm_tpt_c_001.main_17 - Guarded under LCEGT and LCLEG */
75 /*  cm_tpt_c_001.main_18 - Guarded under LWLCEGT */
76 \f
77 #if    (   defined(LCHCT) || defined (LWLCHCT) || defined(LCHIT) \
78         || defined(LCLHC) || defined(TRIL_HZ) \
79         || defined(LCHRT) || defined(LCLHR)   \
80         || defined(LCLMG) || defined(LCMGT)   \
81         || defined(LCLHG) || defined(LCHGT)   \
82         || defined(LCSCT) || defined(LCLSB)   \
83         || defined(LCLNT) || defined(LCLLN)   \
84         || defined(LCLSO) || defined(LCSOT)   \
85         || defined(LCEGT) || defined(LCLEG)   || defined(LWLCEGT) \
86         || defined(CM_COMPRESS)   \
87        )
88
89 #ifdef __cplusplus
90 extern "C" {
91 #endif
92    /* Add prototypes here  (MB) */
93
94 #ifdef __cplusplus
95 }
96 #endif
97
98 \f  
99
100 /*
101  *      PACKING FUNCTIONS
102  */
103 /* Moving IPv4 address packing functions from cm_inet.c */
104 /*
105 *
106 *       Fun:   cmPkCmIpv4TptAddr
107 *
108 *       Desc:  This function packs the IPv4 address 
109 *
110 *       Ret:   ROK
111 *
112 *       Notes: None
113 *
114 *       File:  cm_tpt.c
115 *
116 */
117 #ifdef ANSI
118 S16 cmPkCmIpv4TptAddr
119 (
120 CmIpv4TptAddr            *pkParam,  /* IPv4 Address structure */
121 Buffer                   *mBuf      /* message buffer */
122 )
123 #else
124 S16 cmPkCmIpv4TptAddr (pkParam, mBuf)
125 CmIpv4TptAddr            *pkParam;  /* IPv4 Address structure */
126 Buffer                   *mBuf;     /* message buffer */
127 #endif
128 {
129
130    CMCHKPK(cmPkCmIpv4NetAddr, pkParam->address, mBuf);
131    CMCHKPK(oduUnpackUInt16, pkParam->port, mBuf);
132
133    return ROK;
134 } /* cmPkCmIpv4TptAddr */
135
136 /*
137 *
138 *       Fun:   cmPkCmIpv6NetAddr
139 *
140 *       Desc:  This function packs the 16 bytes of IPv6 address 
141 *
142 *       Ret:   ROK
143 *
144 *       Notes: None
145 *
146 *       File:  cm_tpt.c
147 *
148 */
149 #ifdef ANSI
150 PRIVATE S16 cmPkCmIpv6NetAddr
151 (
152 CmIpv6NetAddr            *pkParam,     
153 Buffer                   *mBuf         /* message buffer */
154 )
155 #else
156 PRIVATE S16 cmPkCmIpv6NetAddr (pkParam, mBuf)
157 CmIpv6NetAddr            *pkParam;     
158 Buffer                   *mBuf;        /* message buffer */
159 #endif
160 {
161    uint8_t num;
162    uint8_t *ptr = (uint8_t*)pkParam;
163
164
165    for(num = 0; num < CM_IPV6ADDR_SIZE; num++)
166    {
167       CMCHKPK(oduUnpackUInt8, *(ptr+num), mBuf);
168    }
169
170    return ROK;
171 } /* end of cmPkCmIpv6NetAddr */
172
173 \f
174 /*
175 *
176 *       Fun:   cmPkCmIpv6TptAddr
177 *
178 *       Desc:  This function packs the IPv6 transport address
179 *
180 *       Ret:   ROK
181 *
182 *       Notes: None
183 *
184 *       File:  cm_tpt.c
185 *
186 */
187 #ifdef ANSI
188 PRIVATE S16 cmPkCmIpv6TptAddr
189 (
190 CmIpv6TptAddr            *pkParam,     /* IPv6 transport address */
191 Buffer                   *mBuf         /* message buffer */
192 )
193 #else
194 PRIVATE S16 cmPkCmIpv6TptAddr (pkParam, mBuf)
195 CmIpv6TptAddr            *pkParam;     /* IPv6 transport address */
196 Buffer                   *mBuf;        /* message buffer */
197 #endif
198 {
199
200    CMCHKPK(cmPkCmIpv6NetAddr, &pkParam->ipv6NetAddr, mBuf);
201    CMCHKPK(oduUnpackUInt16, pkParam->port, mBuf);
202
203    return ROK;
204 }   /* cmPkCmIpv6TptAddr */
205
206 \f
207 /*
208 *
209 *       Fun:   cmPkCmNetAddrTbl
210 *
211 *       Desc:  This function packs the 
212 *
213 *       Ret:   ROK
214 *
215 *       Notes: None
216 *
217 *       File:  cm_tpt.c
218 *
219 */
220 #ifdef ANSI
221 S16 cmPkCmNetAddrTbl
222 (
223 CmNetAddrTbl            *pkParam,      /* Network Address Table */
224 Buffer                  *mBuf          /* message buffer */
225 )
226 #else
227 S16 cmPkCmNetAddrTbl (pkParam, mBuf)
228 CmNetAddrTbl            *pkParam;      /* Network Address Table */
229 Buffer                  *mBuf;         /* message buffer */
230 #endif
231 {
232    uint16_t                  idx;           /* Loop Index */
233    CmNetAddr            *netAddr;      /* Network Address */
234
235
236    if (pkParam->count > CM_MAX_NET_ADDR)
237       return RFAILED;
238
239    /* Pack All the addresses */
240    for (idx = pkParam->count; idx; idx--)
241    {
242       netAddr = &(pkParam->netAddr[idx - 1]);
243
244       if ((cmPkCmNetAddr(netAddr, mBuf)) != ROK)
245          return RFAILED;
246    }
247
248    /* Pack the total number of addresses present in the table */
249    CMCHKPK(oduUnpackUInt16, pkParam->count, mBuf);
250
251    return ROK;
252
253 } /* end of cmPkCmNetAddrTbl() */
254
255 /*
256 *
257 *       Fun:   cmPkCmNetAddr
258 *
259 *       Desc:  This function packs the 
260 *
261 *       Ret:   ROK
262 *
263 *       Notes: None
264 *
265 *       File:  cm_tpt.c
266 *
267 */
268 #ifdef ANSI
269 S16 cmPkCmNetAddr
270 (
271 CmNetAddr                *pkParam,     
272 Buffer                   *mBuf         /* message buffer */
273 )
274 #else
275 S16 cmPkCmNetAddr (pkParam, mBuf)
276 CmNetAddr                *pkParam;     
277 Buffer                   *mBuf;        /* message buffer */
278 #endif
279 {
280
281    switch (pkParam->type)
282    {
283       case CM_NETADDR_NOTPRSNT:
284          break;
285
286       case CM_NETADDR_IPV4:
287          CMCHKPK(cmPkCmIpv4NetAddr, pkParam->u.ipv4NetAddr, mBuf);
288          break;
289
290       case CM_NETADDR_IPV6:
291          CMCHKPK(cmPkCmIpv6NetAddr, &pkParam->u.ipv6NetAddr, mBuf);
292          break;
293
294       default:
295          return RFAILED;
296    }
297    CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf);
298
299    return ROK;
300 }   /* cmPkCmNetAddr */
301
302 \f
303 /*
304 *
305 *       Fun:   cmPkCmTptAddr
306 *
307 *       Desc:  This function packs the 
308 *
309 *       Ret:   ROK
310 *
311 *       Notes: None
312 *
313 *       File:  cm_tpt.c
314 *
315 */
316 #ifdef ANSI
317 S16 cmPkCmTptAddr
318 (
319 CmTptAddr                *pkParam,     
320 Buffer                   *mBuf         /* message buffer */
321 )
322 #else
323 S16 cmPkCmTptAddr (pkParam, mBuf)
324 CmTptAddr                *pkParam;     
325 Buffer                   *mBuf;        /* message buffer */
326 #endif
327 {
328
329    switch (pkParam->type)
330    {
331       case CM_TPTADDR_NOTPRSNT:
332          break;
333
334       case CM_TPTADDR_IPV4:
335          CMCHKPK(cmPkCmIpv4TptAddr, &pkParam->u.ipv4TptAddr, mBuf);
336          break;
337
338       case CM_TPTADDR_IPV6:
339          CMCHKPK(cmPkCmIpv6TptAddr, &pkParam->u.ipv6TptAddr, mBuf);
340          break;
341    
342       default:
343          return RFAILED;
344    }
345    CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf);
346
347    return ROK;
348 }   /* cmPkCmTptAddr */
349
350 /* added new packing functions */
351 #ifdef LOCAL_INTF
352 /*
353 *
354 *       Fun:   cmPkCmTptLocalInf
355 *
356 *       Desc:  This function packs the local interface info on which IPV4/IPV6
357 *              packet was received on.
358 *
359 *       Ret:   ROK
360 *
361 *       Notes: None
362 *
363 *       File:  cm_tpt.c
364 *
365 */
366 #ifdef ANSI
367 S16 cmPkCmTptLocalInf
368 (
369 CmTptLocalInf           *pkParam,   /* local interface info */
370 Buffer                  *mBuf       /* message buffer */
371 )
372 #else
373 S16 cmPkCmTptLocalInf (pkParam, mBuf)
374 CmTptLocalInf           *pkParam;   /* local interface info */
375 Buffer                  *mBuf;      /* message buffer */
376 #endif
377 {
378
379    if (pkParam->intfPrsnt == TRUE)
380    {  
381       /* pack the actual interface address */ 
382       CMCHKPK(cmPkCmNetAddr, &pkParam->localIfAddr, mBuf); 
383       /* pack the interface index value */
384       CMCHKPK(oduUnpackUInt32, pkParam->localIf, mBuf);
385    }
386    /* pack the boll which indicates if valid local intf is present or not */
387    CMCHKPK(oduUnpackUInt8, pkParam->intfPrsnt, mBuf);
388    return ROK;
389 }   /* cmPkCmTptLocalInf */
390 #endif /* LOCAL_INTF */
391
392 /* Moving IPv6 multicast information packing functions from cm_inet.c */
393 #ifdef IPV6_SUPPORTED
394 /*
395 *
396 *       Fun:   cmPkCmNetMCastInf6
397 *
398 *       Desc:  This function packs the IPv6 multicast information 
399 *
400 *       Ret:   ROK
401 *
402 *       Notes: None
403 *
404 *       File:  cm_tpt.c
405 *
406 */
407 #ifdef ANSI
408 S16 cmPkCmNetMCastInf6
409 (
410 CmNetMCastInf6            *pkParam,     /* IPv6 multicast information */
411 Buffer                    *mBuf         /* message buffer */
412 )
413 #else
414 S16 cmPkCmNetMCastInf6(pkParam, mBuf)
415 CmNetMCastInf6            *pkParam;     /* IPv6 multicast information */
416 Buffer                    *mBuf;        /* message buffer */
417 #endif
418 {
419
420    CMCHKPK(cmPkCmIpv6NetAddr, &pkParam->mCastAddr, mBuf);
421    CMCHKPK(oduUnpackUInt32, pkParam->localInf, mBuf);
422
423    return ROK;
424 }   /* cmPkCmNetMCastInf6 */
425 #endif /* IPV6_SUPPORTED */
426
427 \f
428 /*
429 *
430 *       Fun:   cmPkCmSockOpts
431 *
432 *       Desc:  This function packs the 
433 *
434 *       Ret:   ROK
435 *
436 *       Notes: None
437 *
438 *       File:  cm_tpt.c
439 *
440 */
441 #ifdef ANSI
442 PRIVATE S16 cmPkCmSockOpts
443 (
444 CmSockOpts               *pkParam,     
445 Buffer                   *mBuf         /* message buffer */
446 )
447 #else
448 PRIVATE S16 cmPkCmSockOpts (pkParam, mBuf)
449 CmSockOpts               *pkParam;     
450 Buffer                   *mBuf;        /* message buffer */
451 #endif
452 {
453
454    switch (pkParam->option)
455    {
456       case CM_SOCKOPT_OPT_ADD_MCAST_MBR:
457       case CM_SOCKOPT_OPT_DRP_MCAST_MBR:
458 #ifdef CM_INET2
459          CMCHKPK(cmPkCmNetAddr, &pkParam->optVal.mCastInfo.mCastAddr, mBuf);
460          CMCHKPK(cmPkCmNetAddr, &pkParam->optVal.mCastInfo.localAddr, mBuf);
461 #else
462          CMCHKPK(cmPkCmNetAddr, &pkParam->optVal.mCastAddr, mBuf);
463 #endif /* CM_INET2 */
464          break;
465
466       case CM_SOCKOPT_OPT_MCAST_IF:
467          CMCHKPK(cmPkCmNetAddr, &pkParam->optVal.lclAddr, mBuf);
468          break;
469
470 #ifdef IPV6_SUPPORTED
471       case CM_SOCKOPT_OPT_ADD_MCAST6_MBR:
472       case CM_SOCKOPT_OPT_DRP_MCAST6_MBR:
473          CMCHKPK(cmPkCmNetMCastInf6, &pkParam->optVal.mCastInfo6, mBuf);
474          break;
475
476       case CM_SOCKOPT_OPT_MCAST6_IF:
477          CMCHKPK(oduUnpackUInt32, pkParam->optVal.infId, mBuf);
478          break;
479
480 #endif /* IPV6_SUPPORTED */
481
482       default:
483          CMCHKPK(oduUnpackUInt32, pkParam->optVal.value, mBuf);
484          break;
485    }
486    CMCHKPK(oduUnpackUInt32, pkParam->option, mBuf);
487    CMCHKPK(oduUnpackUInt32, pkParam->level, mBuf);
488
489    return ROK;
490 }   /* cmPkCmSockOpts */
491
492 \f
493 /*
494 *
495 *       Fun:   cmPkCmSockParam
496 *
497 *       Desc:  This function packs the 
498 *
499 *       Ret:   ROK
500 *
501 *       Notes: None
502 *
503 *       File:  cm_tpt.c
504 *
505 */
506 #ifdef ANSI
507 PRIVATE S16 cmPkCmSockParam
508 (
509 CmSockParam              *pkParam,     
510 Buffer                   *mBuf         /* message buffer */
511 )
512 #else
513 PRIVATE S16 cmPkCmSockParam (pkParam, mBuf)
514 CmSockParam              *pkParam;     
515 Buffer                   *mBuf;        /* message buffer */
516 #endif
517 {
518    uint32_t num;
519
520
521    if( pkParam->numOpts > CM_MAX_SOCK_OPTS)
522    {
523       return RFAILED;
524    }
525    for(num = 0; num < pkParam->numOpts; num++)
526    {
527       CMCHKPK(cmPkCmSockOpts, &pkParam->sockOpts[num], mBuf);
528    }
529    CMCHKPK(oduUnpackUInt8, pkParam->numOpts, mBuf);
530    CMCHKPK(oduUnpackUInt8, pkParam->listenQSize, mBuf);
531
532    return ROK;
533 }   /* cmPkCmSockParam */
534
535 \f
536 #ifdef CM_TLS
537 /*
538 *
539 *       Fun:   cmPkTlsTptParam
540 *
541 *       Desc:  This function packs the 
542 *
543 *       Ret:   ROK
544 *
545 *       Notes: None
546 *
547 *       File:  cm_tpt.c
548 *
549 */
550 #ifdef ANSI
551 PRIVATE S16 cmPkTlsTptParam
552 (
553 TlsTptParam              *pkParam,     /**/
554 Buffer                   *mBuf         /* message buffer */
555 )
556 #else
557 PRIVATE S16 cmPkTlsTptParam(pkParam, mBuf)
558 TlsTptParam              *pkParam;     /**/
559 Buffer                   *mBuf;        /* message buffer */
560 #endif
561 {
562    uint32_t num;
563
564
565    if( pkParam->numOpts > CM_MAX_SOCK_OPTS)
566    {
567       return RFAILED;
568    }
569    for(num = 0; num < pkParam->numOpts; num++)
570    {
571       CMCHKPK(cmPkCmSockOpts, &pkParam->sockOpts[num], mBuf);
572    }
573    CMCHKPK(oduUnpackUInt8, pkParam->numOpts, mBuf);
574    CMCHKPK(oduUnpackUInt8, pkParam->listenQSize, mBuf);
575    CMCHKPK(SPkS16, pkParam->ctxId, mBuf);
576
577    return ROK;
578 }  /* cmPkTlsTptParam */
579
580 #endif  /* CM_TLS */
581
582 \f
583 /*
584 *
585 *       Fun:   cmPkCmTptParam
586 *
587 *       Desc:  This function packs the 
588 *
589 *       Ret:   ROK
590 *
591 *       Notes: None
592 *
593 *       File:  cm_tpt.c
594 *
595 */
596 #ifdef ANSI
597 S16 cmPkCmTptParam
598 (
599 CmTptParam               *pkParam,     
600 Buffer                   *mBuf         /* message buffer */
601 )
602 #else
603 S16 cmPkCmTptParam (pkParam, mBuf)
604 CmTptParam               *pkParam;     
605 Buffer                   *mBuf;        /* message buffer */
606 #endif
607 {
608
609    switch (pkParam->type)
610    {
611       case CM_TPTPARAM_NOTPRSNT:
612          break;
613
614       case CM_TPTPARAM_SOCK:
615          CMCHKPK(cmPkCmSockParam, &pkParam->u.sockParam, mBuf);
616          break;
617
618 #ifdef CM_AAL
619       case CM_TPTPARAM_AAL:
620          CMCHKPK(cmPkAalConParam, &pkParam->u.aalParam, mBuf);
621          break;
622 #endif
623
624 #ifdef CM_TLS
625       case CM_TPTPARAM_TLS:
626          CMCHKPK(cmPkTlsTptParam, &pkParam->u.tlsParam, mBuf);
627          break;
628 #endif
629
630       default:
631          return RFAILED;
632    }
633
634    CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf);
635
636    return ROK;
637 }   /* cmPkCmTptParam */
638
639 \f  
640 /*
641  *      UNPACKING FUNCTIONS
642  */
643
644 /* Moving IPv4 address un-packing functions from cm_inet.c file */
645
646 /*
647 *
648 *       Fun:   cmUnpkCmIpv4TptAddr
649 *
650 *       Desc:  This function unpacks the IPv4 address
651 *
652 *       Ret:   ROK
653 *
654 *       Notes: None
655 *
656 *       File:  cm_tpt.c
657 *
658 */
659 #ifdef ANSI
660 S16 cmUnpkCmIpv4TptAddr 
661 (
662 CmIpv4TptAddr            *unpkParam,     /* IPv4 Address */
663 Buffer                   *mBuf           /* message buffer */
664 )
665 #else
666 S16 cmUnpkCmIpv4TptAddr (unpkParam, mBuf)
667 CmIpv4TptAddr            *unpkParam;     /* IPv4 Address */
668 Buffer                   *mBuf;          /* message buffer */
669 #endif
670 {
671
672    CMCHKUNPK(oduPackUInt16, &unpkParam->port, mBuf);
673    CMCHKUNPK(cmUnpkCmIpv4NetAddr, &unpkParam->address, mBuf);
674
675    return ROK;
676 }   /* cmUnpkCmIpv4TptAddr */
677
678 \f
679 /*
680 *
681 *       Fun:   cmUnpkCmIpv6NetAddr
682 *
683 *       Desc:  This function unpacks the 16 bytes of IPv6 address 
684 *
685 *       Ret:   ROK
686 *
687 *       Notes: None
688 *
689 *       File:  cm_tpt.c
690 *
691 */
692 #ifdef ANSI
693 PRIVATE S16 cmUnpkCmIpv6NetAddr
694 (
695 CmIpv6NetAddr            *unpkParam,   /* IPv6 address */
696 Buffer                   *mBuf         /* message buffer */
697 )
698 #else
699 PRIVATE S16 cmUnpkCmIpv6NetAddr (unpkParam, mBuf)
700 CmIpv6NetAddr            *unpkParam;   /* IPv6 address */
701 Buffer                   *mBuf;        /* message buffer */
702 #endif
703 {
704    uint32_t num;
705    uint8_t *ptr = (uint8_t*)unpkParam;
706
707
708    ptr += (CM_INET_IPV6ADDR_SIZE - 1);
709
710    for(num = 0; num < CM_IPV6ADDR_SIZE; num++)
711    {
712       CMCHKUNPK(oduPackUInt8, (ptr-num), mBuf);
713    }
714
715    return ROK;
716 } /* end of cmUnpkCmIpv6NetAddr */
717
718 \f
719 /*
720 *
721 *       Fun:   cmUnpkCmIpv6TptAddr
722 *
723 *       Desc:  This function unpacks the IPv6 transport address
724 *
725 *       Ret:   ROK
726 *
727 *       Notes: None
728 *
729 *       File:  cm_tpt.c
730 *
731 */
732 #ifdef ANSI
733 PRIVATE S16 cmUnpkCmIpv6TptAddr
734 (
735 CmIpv6TptAddr            *unpkParam,   /* IPv6 transport address */
736 Buffer                   *mBuf         /* message buffer */
737 )
738 #else
739 PRIVATE S16 cmUnpkCmIpv6TptAddr (unpkParam, mBuf)
740 CmIpv6TptAddr            *unpkParam;   /* IPv6 transport address */
741 Buffer                   *mBuf;        /* message buffer */
742 #endif
743 {
744
745    CMCHKUNPK(oduPackUInt16, &unpkParam->port, mBuf);
746    CMCHKUNPK(cmUnpkCmIpv6NetAddr, &unpkParam->ipv6NetAddr, mBuf);
747
748    return ROK;
749 }   /* cmUnpkCmIpv6TptAddr */
750
751 \f
752 /*
753 *
754 *       Fun:   cmUnpkCmNetAddrTbl
755 *
756 *       Desc:  This function unpacks the 
757 *
758 *       Ret:   ROK
759 *
760 *       Notes: None
761 *
762 *       File:  cm_tpt.c
763 *
764 */
765 #ifdef ANSI
766 S16 cmUnpkCmNetAddrTbl
767 (
768 CmNetAddrTbl            *unpkParam,    /* Network Address Table */
769 Buffer                  *mBuf          /* message buffer */
770 )
771 #else
772 S16 cmUnpkCmNetAddrTbl (unpkParam, mBuf )
773 CmNetAddrTbl            *unpkParam;    /* Network Address Table */
774 Buffer                  *mBuf;         /* message buffer */
775 #endif
776 {
777    uint16_t                  idx;           /* Loop Index */
778    CmNetAddr            *netAddr;      /* Network Address */
779    
780
781    /* Unpack the count */
782    CMCHKUNPK(oduPackUInt16, &(unpkParam->count), mBuf);
783
784    /* Unpack the addresses */
785    for (idx = 0; idx < unpkParam->count; idx++)
786    {
787       netAddr = &(unpkParam->netAddr[idx]);
788
789       if ((cmUnpkCmNetAddr(netAddr, mBuf)) != ROK)
790          return RFAILED;
791    }
792
793    return ROK;
794
795 } /* end of cmUnpkCmNetAddrTbl() */
796
797 \f
798 /*
799 *
800 *       Fun:   cmUnpkCmNetAddr
801 *
802 *       Desc:  This function unpacks the network address
803 *
804 *       Ret:   ROK
805 *
806 *       Notes: None
807 *
808 *       File:  cm_tpt.c
809 *
810 */
811 #ifdef ANSI
812 S16 cmUnpkCmNetAddr
813 (
814 CmNetAddr                *unpkParam,   
815 Buffer                   *mBuf         /* message buffer */
816 )
817 #else
818 S16 cmUnpkCmNetAddr (unpkParam, mBuf )
819 CmNetAddr                *unpkParam;   
820 Buffer                   *mBuf;        /* message buffer */
821 #endif
822 {
823
824    CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf);
825
826    switch (unpkParam->type)
827    {
828       case CM_NETADDR_NOTPRSNT:
829          break;
830
831       case CM_NETADDR_IPV4:
832          CMCHKUNPK(cmUnpkCmIpv4NetAddr, &unpkParam->u.ipv4NetAddr, mBuf);
833          break;
834
835       case CM_NETADDR_IPV6:
836          CMCHKUNPK(cmUnpkCmIpv6NetAddr, &unpkParam->u.ipv6NetAddr, mBuf);
837          break;
838
839       default:
840          return RFAILED;
841    }
842
843    return ROK;
844 }   /* cmUnpkCmNetAddr */
845
846 \f
847 /*
848 *
849 *       Fun:   cmUnpkCmTptAddr
850 *
851 *       Desc:  This function unpacks the 
852 *
853 *       Ret:   ROK
854 *
855 *       Notes: None
856 *
857 *       File:  cm_tpt.c
858 *
859 */
860 #ifdef ANSI
861 S16 cmUnpkCmTptAddr
862 (
863 CmTptAddr                *unpkParam,   
864 Buffer                   *mBuf         /* message buffer */
865 )
866 #else
867 S16 cmUnpkCmTptAddr (unpkParam, mBuf)
868 CmTptAddr                *unpkParam;   
869 Buffer                   *mBuf;        /* message buffer */
870 #endif
871 {
872
873    CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf);
874
875    switch (unpkParam->type)
876    {
877       case CM_TPTADDR_NOTPRSNT:
878          break;
879
880       case CM_TPTADDR_IPV4:
881          CMCHKUNPK(cmUnpkCmIpv4TptAddr, &unpkParam->u.ipv4TptAddr, mBuf);
882          break;
883
884       case CM_TPTADDR_IPV6:
885          CMCHKUNPK(cmUnpkCmIpv6TptAddr, &unpkParam->u.ipv6TptAddr, mBuf);
886          break;
887
888       default:
889          return RFAILED;
890    }
891
892    return ROK;
893 }   /* cmUnpkCmTptAddr */
894
895 /* Moving IPv6 multicast information unpacking functions from cm_inet.c */
896 #ifdef IPV6_SUPPORTED
897 \f
898 /*
899 *
900 *       Fun:   cmUnpkCmNetMCastInf6
901 *
902 *       Desc:  This function unpacks the IPv6 multicast information 
903 *
904 *       Ret:   ROK
905 *
906 *       Notes: None
907 *
908 *       File:  cm_tpt.c
909 *
910 */
911 #ifdef ANSI
912 S16 cmUnpkCmNetMCastInf6
913 (
914 CmNetMCastInf6            *unpkParam,   /* IPv6 multicast information */
915 Buffer                    *mBuf         /* message buffer */
916 )
917 #else
918 S16 cmUnpkCmNetMCastInf6(unpkParam, mBuf)
919 CmNetMCastInf6            *unpkParam;   /* IPv6 multicast information */
920 Buffer                    *mBuf;        /* message buffer */
921 #endif
922 {
923
924     CMCHKUNPK(oduPackUInt32, &unpkParam->localInf, mBuf);
925     CMCHKUNPK(cmUnpkCmIpv6NetAddr, &unpkParam->mCastAddr, mBuf);
926
927    return ROK;
928 }   /* cmUnpkCmNetMCastInf6 */
929 #endif /* IPV6_SUPPORTED */
930
931 \f
932 /*
933 *
934 *       Fun:   cmUnpkCmSockOpts
935 *
936 *       Desc:  This function unpacks the socket options
937 *
938 *       Ret:   ROK
939 *
940 *       Notes: None
941 *
942 *       File:  cm_tpt.c
943 *
944 */
945 #ifdef ANSI
946 PRIVATE S16 cmUnpkCmSockOpts
947 (
948 CmSockOpts               *unpkParam,   /* socket options */
949 Buffer                   *mBuf         /* message buffer */
950 )
951 #else
952 PRIVATE S16 cmUnpkCmSockOpts (unpkParam, mBuf)
953 CmSockOpts               *unpkParam;   /* socket options */
954 Buffer                   *mBuf;        /* message buffer */
955 #endif
956 {
957
958    CMCHKUNPK(oduPackUInt32, &unpkParam->level, mBuf);
959    CMCHKUNPK(oduPackUInt32, &unpkParam->option, mBuf);
960
961    switch (unpkParam->option)
962    {
963       case CM_SOCKOPT_OPT_ADD_MCAST_MBR:
964       case CM_SOCKOPT_OPT_DRP_MCAST_MBR:
965 #ifdef CM_INET2
966          CMCHKUNPK(cmUnpkCmNetAddr, &unpkParam->optVal.mCastInfo.localAddr, 
967                    mBuf);
968          CMCHKUNPK(cmUnpkCmNetAddr, &unpkParam->optVal.mCastInfo.mCastAddr, 
969                    mBuf);
970 #else
971          CMCHKUNPK(cmUnpkCmNetAddr, &unpkParam->optVal.mCastAddr, mBuf);
972 #endif /* CM_INET2 */
973          break;
974
975       case CM_SOCKOPT_OPT_MCAST_IF:
976          CMCHKUNPK(cmUnpkCmNetAddr, &unpkParam->optVal.lclAddr, mBuf);
977          break;
978
979 #ifdef IPV6_SUPPORTED
980       case CM_SOCKOPT_OPT_ADD_MCAST6_MBR:
981       case CM_SOCKOPT_OPT_DRP_MCAST6_MBR:
982          CMCHKUNPK(cmUnpkCmNetMCastInf6, &unpkParam->optVal.mCastInfo6, mBuf);
983          break;
984
985       case CM_SOCKOPT_OPT_MCAST6_IF:
986          CMCHKUNPK(oduPackUInt32, &unpkParam->optVal.infId, mBuf);
987          break;
988 #endif /* IPV6_SUPPORTED */
989
990       default:
991          CMCHKUNPK(oduPackUInt32, &unpkParam->optVal.value, mBuf);
992          break;
993    }
994
995    return ROK;
996 }   /* cmUnpkCmSockOpts */
997
998 \f
999 /*
1000 *
1001 *       Fun:   cmUnpkCmSockParam
1002 *
1003 *       Desc:  This function unpacks the socket parameters
1004 *
1005 *       Ret:   ROK
1006 *
1007 *       Notes: None
1008 *
1009 *       File:  cm_tpt.c
1010 *
1011 */
1012 #ifdef ANSI
1013 PRIVATE S16 cmUnpkCmSockParam
1014 (
1015 CmSockParam              *unpkParam,   /* socket parameters */
1016 Buffer                   *mBuf         /* message buffer */
1017 )
1018 #else
1019 PRIVATE S16 cmUnpkCmSockParam (unpkParam, mBuf)
1020 CmSockParam              *unpkParam;   /* socket parameters */
1021 Buffer                   *mBuf;        /* message buffer */
1022 #endif
1023 {
1024    uint32_t num;
1025
1026
1027    CMCHKUNPK(oduPackUInt8, &unpkParam->listenQSize, mBuf);
1028    CMCHKUNPK(oduPackUInt8, &unpkParam->numOpts, mBuf);
1029
1030    if( unpkParam->numOpts > CM_MAX_SOCK_OPTS)
1031    {
1032       return RFAILED;
1033    }
1034
1035    for(num = 0; num < unpkParam->numOpts; num++)
1036    {
1037       CMCHKUNPK(cmUnpkCmSockOpts, &unpkParam->sockOpts[num], mBuf);
1038    }
1039
1040    return ROK;
1041 }   /* cmUnpkCmSockParam */
1042
1043 \f
1044 #ifdef CM_TLS
1045 /*
1046 *
1047 *       Fun:   cmUnpkTlsTptParam
1048 *
1049 *       Desc:  This function unpacks the socket parameters
1050 *
1051 *       Ret:   ROK
1052 *
1053 *       Notes: None
1054 *
1055 *       File:  cm_tpt.c
1056 *
1057 */
1058 #ifdef ANSI
1059 PRIVATE S16 cmUnpkTlsTptParam
1060 (
1061 TlsTptParam              *unpkParam,   /* TLS parameters */
1062 Buffer                   *mBuf         /* message buffer */
1063 )
1064 #else
1065 PRIVATE S16 cmUnpkTlsTptParam (unpkParam, mBuf)
1066 TlsTptParam              *unpkParam;   /* TLS parameters */
1067 Buffer                   *mBuf;        /* message buffer */
1068 #endif
1069 {
1070    uint32_t num;
1071
1072
1073    CMCHKUNPK(SUnpkS16, &unpkParam->ctxId, mBuf);
1074    CMCHKUNPK(oduPackUInt8, &unpkParam->listenQSize, mBuf);
1075    CMCHKUNPK(oduPackUInt8, &unpkParam->numOpts, mBuf);
1076
1077    if( unpkParam->numOpts > CM_MAX_SOCK_OPTS)
1078    {
1079       return RFAILED;
1080    }
1081
1082    for(num = 0; num < unpkParam->numOpts; num++)
1083    {
1084       CMCHKUNPK(cmUnpkCmSockOpts, &unpkParam->sockOpts[num], mBuf);
1085    }
1086
1087    return ROK;
1088 }  /* cmUnpkTlsTptParam */
1089
1090 #endif  /* CM_TLS */
1091
1092 \f
1093 /*
1094 *
1095 *       Fun:   cmUnpkCmTptParam
1096 *
1097 *       Desc:  This function unpacks the transport parameters 
1098 *
1099 *       Ret:   ROK
1100 *
1101 *       Notes: None
1102 *
1103 *       File:  cm_tpt.c
1104 *
1105 */
1106 #ifdef ANSI
1107 S16 cmUnpkCmTptParam
1108 (
1109 CmTptParam               *unpkParam,   /* transport parameters */
1110 Buffer                   *mBuf         /* message buffer */
1111 )
1112 #else
1113 S16 cmUnpkCmTptParam (unpkParam, mBuf)
1114 CmTptParam               *unpkParam;   /* transport parameters */
1115 Buffer                   *mBuf;        /* message buffer */
1116 #endif
1117 {
1118
1119    CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf);
1120
1121    switch (unpkParam->type)
1122    {
1123       case CM_TPTPARAM_NOTPRSNT:
1124          break;
1125
1126       case CM_TPTPARAM_SOCK:
1127          CMCHKUNPK(cmUnpkCmSockParam, &unpkParam->u.sockParam, mBuf);
1128          break;
1129
1130 #ifdef CM_AAL
1131       case CM_TPTPARAM_AAL:
1132          CMCHKUNPK(cmUnpkAalConParam, &unpkParam->u.aalParam, mBuf);
1133          break;
1134 #endif
1135
1136 #ifdef CM_TLS
1137       case CM_TPTPARAM_TLS:
1138          CMCHKUNPK(cmUnpkTlsTptParam, &unpkParam->u.tlsParam, mBuf);
1139          break;
1140 #endif
1141
1142       default:
1143          return RFAILED;
1144    }
1145
1146    return ROK;
1147 }   /* cmUnpkCmTptParam */
1148
1149
1150 #ifdef CM_INET2  
1151 \f
1152 /*
1153 *
1154 *       Fun:   cmPkCmIpHdrParm
1155 *
1156 *       Desc:  This function packs the the IP hedear parameters for both 
1157 *              IPV4 and IPV6. 
1158 *
1159 *       Ret:   ROK
1160 *
1161 *       Notes: None
1162 *
1163 *       File:  cm_tpt.c
1164 *
1165 */
1166 #ifdef ANSI
1167 S16 cmPkCmIpHdrParm
1168 (
1169 CmIpHdrParm             *pkParam,   /* IP hdr parameters */ 
1170 Buffer                  *mBuf       /* message buffer */
1171 )
1172 #else
1173 S16 cmPkCmIpHdrParm (pkParam, mBuf)
1174 CmIpHdrParm             *pkParam;   /* IP hdr parameters */
1175 Buffer                  *mBuf;      /* message buffer */
1176 #endif
1177 {
1178
1179    switch (pkParam->type)
1180    {
1181       case CM_HDRPARM_NOTPRSNT:
1182       case CM_HDRPARM_ICMP6:
1183          break;
1184
1185       case CM_HDRPARM_IPV4:
1186
1187          /* call to pack ipv4 options */
1188 #ifdef IPV4_OPTS_SUPPORTED
1189          /* ipv4 IP options */
1190          CMCHKPK(cmPkTknStr64, &pkParam->u.hdrParmIpv4.ipv4HdrOpt, mBuf);
1191 #endif /* IPV4_OPTS_SUPPORTED */
1192          
1193          CMCHKPK(cmPkTknUInt8, &pkParam->u.hdrParmIpv4.ttl, mBuf);
1194          CMCHKPK(cmPkTknUInt8, &pkParam->u.hdrParmIpv4.tos, mBuf);
1195          CMCHKPK(cmPkTknUInt8, &pkParam->u.hdrParmIpv4.dfBit, mBuf); 
1196          CMCHKPK(cmPkTknUInt8, &pkParam->u.hdrParmIpv4.proto, mBuf);
1197          break;
1198
1199       case CM_HDRPARM_IPV6:
1200 #ifdef IPV6_SUPPORTED    
1201          /* call to pack ipv6 extn hdrs */
1202 #ifdef IPV6_OPTS_SUPPORTED 
1203          /* pack IPV6 extension headers */
1204          CMCHKPK(cmPkCmIpv6ExtHdr, &pkParam->u.hdrParmIpv6.ipv6ExtHdr, mBuf);
1205 #endif /* IPV6_OPTS_SUPPORTED */
1206          CMCHKPK(cmPkCmNetAddr, &pkParam->u.hdrParmIpv6.srcAddr6, mBuf); 
1207          CMCHKPK(cmPkTknUInt8, &pkParam->u.hdrParmIpv6.ttl, mBuf);          
1208 #endif /* IPV6_SUPPORTED */ 
1209          break;
1210    
1211       default:
1212          return RFAILED;
1213    }
1214    CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf);
1215
1216    return ROK;
1217 }   /* End of cmPkCmIpHdrParm */
1218
1219 \f
1220 /* added new unpack function for local interface */
1221 #ifdef LOCAL_INTF
1222 /*
1223 *
1224 *       Fun:   cmUnpkCmTptLocalInf
1225 *
1226 *       Desc:  This function unpacks the local interface info on which 
1227 *              IPV4/IPV6 packet was received on.
1228 *
1229 *       Ret:   ROK
1230 *
1231 *       Notes: None
1232 *
1233 *       File:  cm_tpt.c
1234 *
1235 */
1236 #ifdef ANSI
1237 S16 cmUnpkCmTptLocalInf
1238 (
1239 CmTptLocalInf           *unpkParam, /* local interface info */
1240 Buffer                  *mBuf       /* message buffer */
1241 )
1242 #else
1243 S16 cmUnpkCmTptLocalInf (unpkParam, mBuf)
1244 CmTptLocalInf           *unpkParam; /* local interface info */
1245 Buffer                  *mBuf;      /* message buffer */
1246 #endif
1247 {
1248
1249    /* first unpack the bool intfPrsnt value which is always packed */
1250    CMCHKUNPK(oduUnpackBool, &unpkParam->intfPrsnt, mBuf);
1251    
1252    /* if the above unpacked bool is TRUE then we have to unpack further
1253     * to get the local intf index and intf address */   
1254    if (unpkParam->intfPrsnt == TRUE)
1255    {   
1256       CMCHKUNPK(oduPackUInt32, &unpkParam->localIf, mBuf);
1257       CMCHKUNPK(cmUnpkCmNetAddr, &unpkParam->localIfAddr, mBuf); 
1258    }
1259    return ROK;
1260 }   /* cmUnpkCmTptLocalInf */
1261 #endif /* LOCAL_INTF */
1262
1263 \f
1264 /* added new functions */
1265 #ifdef IPV6_OPTS_SUPPORTED 
1266 /*
1267 *       Fun:   cmPkCmIpv6ExtHdr
1268 *
1269 *       Desc:  This function packs the IPV6 extension headers
1270 *
1271 *       Ret:   ROK
1272 *
1273 *       Notes: None
1274 *
1275 *       File:  cm_tpt.c
1276 *
1277 */
1278 #ifdef ANSI
1279 S16 cmPkCmIpv6ExtHdr
1280 (
1281 CmIpv6ExtHdr             *pkParam,   /* IPV6 extension hdrs */
1282 Buffer                   *mBuf       /* message buffer */
1283 )
1284 #else
1285 S16 cmPkCmIpv6ExtHdr (pkParam, mBuf)
1286 CmIpv6ExtHdr             *pkParam;   /*IPV6 extension hdrs */
1287 Buffer                   *mBuf;      /* message buffer */
1288 #endif
1289 {
1290
1291    /* pack first Route hdr */   
1292    if (pkParam->rtOptsPrsnt)
1293       CMCHKPK(cmPkCmIpv6RtHdr, &pkParam->rtOpts, mBuf);  
1294    CMCHKPK(oduPackBool, pkParam->rtOptsPrsnt, mBuf);  
1295
1296    /* pack Dest Opt hdr */
1297    if (pkParam->destOptsPrsnt)
1298       CMCHKPK(cmPkCmIpv6DestOptsArr, &pkParam->destOptsArr, mBuf);  
1299    CMCHKPK(oduPackBool, pkParam->destOptsPrsnt, mBuf);  
1300
1301    /* pack HBH hdr */
1302    if (pkParam->hbhHdrPrsnt)
1303       CMCHKPK(cmPkCmIpv6HBHHdrArr, &pkParam->hbhOptsArr, mBuf);  
1304    CMCHKPK(oduPackBool, pkParam->hbhHdrPrsnt, mBuf);  
1305
1306    return ROK;
1307 } /* end of cmPkCmIpv6ExtHdr */
1308
1309 \f
1310 /*
1311 *
1312 *       Fun:   cmPkCmIpv6RtHdr
1313 *
1314 *       Desc:  This function packs the IPV6 route header
1315 *
1316 *       Ret:   ROK
1317 *
1318 *       Notes: None
1319 *
1320 *       File:  cm_tpt.c
1321 *
1322 */
1323 #ifdef ANSI
1324 S16 cmPkCmIpv6RtHdr
1325 (
1326 CmIpv6RtHdr             *pkParam,   /* IPV6 Route hdr */
1327 Buffer                   *mBuf      /* message buffer */
1328 )
1329 #else
1330 S16 cmPkCmIpv6RtHdr (pkParam, mBuf)
1331 CmIpv6RtHdr             *pkParam;   /* IPV6 Route hdr */
1332 Buffer                   *mBuf;     /* message buffer */
1333 #endif
1334 {
1335    uint8_t idx;
1336    
1337
1338    /* pack all IPV6 addrs in the route hdr */
1339    for(idx = 0; idx < pkParam->numAddrs; idx++)
1340    {
1341       CMCHKPK(cmPkCmIpv6NetAddr, &pkParam->ipv6Addrs[idx], mBuf);
1342    }
1343    /* pack reserve byte & strict/loose bit map */
1344    CMCHKPK(oduUnpackUInt32, pkParam->slMap, mBuf);
1345    CMCHKPK(oduUnpackUInt8, pkParam->numAddrs, mBuf);  
1346
1347    return ROK;
1348 } /* end of cmPkCmIpv6RtHdr */
1349
1350 \f
1351 /*
1352 *
1353 *       Fun:   cmUnpkCmIpv6RtHdr
1354 *
1355 *       Desc:  This function unpacks the IPV6 route header
1356 *
1357 *       Ret:   ROK
1358 *              ROUTRES - out of resources
1359 *
1360 *       Notes: None
1361 *
1362 *       File:  cm_tpt.c
1363 *
1364 */
1365 #ifdef ANSI
1366 S16 cmUnpkCmIpv6RtHdr
1367 (
1368 CmIpv6RtHdr             *unpkParam,  /* IPV6 Route hdr */
1369 Buffer                  *mBuf,       /* message buffer */
1370 Mem                     *memInfo     /* meminfo to allocate for Route hdr */
1371 )
1372 #else
1373 S16 cmUnpkCmIpv6RtHdr (unpkParam, mBuf, memInfo)
1374 CmIpv6RtHdr             *unpkParam;  /* IPV6 Route hdr */
1375 Buffer                  *mBuf;       /* message buffer */
1376 Mem                     *memInfo;    /* meminfo to allocate for Route hdr */
1377 #endif
1378 {
1379    uint8_t idx;  /* array index */
1380    S32 retVal; /* temporary return value */
1381    
1382    
1383    CMCHKUNPK(oduPackUInt8, &unpkParam->numAddrs, mBuf);
1384    
1385    /* unpack reserve byte & strict/loose bit map */
1386    CMCHKUNPK(oduPackUInt32, &unpkParam->slMap, mBuf);
1387    
1388    retVal = SGetSBuf(memInfo->region,    
1389                   memInfo->pool,                     
1390                  (Data **)&unpkParam->ipv6Addrs, 
1391                  (unpkParam->numAddrs * 16));
1392       
1393    if (retVal != ROK)
1394    {
1395       return (ROUTRES);
1396    }
1397    
1398    /* unpack all IPV6 addrs in the route hdr */
1399    for(idx = 0; idx < unpkParam->numAddrs; idx++)
1400    {
1401       CMCHKUNPK(cmUnpkCmIpv6NetAddr, &unpkParam->ipv6Addrs[idx], mBuf);
1402    }
1403
1404    return ROK;
1405 } /* end of cmUnpkCmIpv6RtHdr */
1406
1407 \f
1408 /*
1409 *
1410 *       Fun:   cmUnpkCmIpv6ExtHdr
1411 *
1412 *       Desc:  This function unpacks the IPv6 extension header
1413 *
1414 *       Ret:   ROK
1415 *
1416 *       Notes: None
1417 *
1418 *       File:  cm_tpt.c
1419 *
1420 */
1421 #ifdef ANSI
1422 S16 cmUnpkCmIpv6ExtHdr
1423 (
1424 CmIpv6ExtHdr             *unpkParam,  /* IPV6 extension hdrs */
1425 Buffer                   *mBuf,       /* message buffer */
1426 Mem                      *memInfo     /* meminfo to allocate for IPV6 ext hdr */
1427 )
1428 #else
1429 S16 cmUnpkCmIpv6ExtHdr (unpkParam, mBuf, memInfo)
1430 CmIpv6ExtHdr             *unpkParam; /* IPV6 extension hdrs */
1431 Buffer                   *mBuf;      /* message buffer */
1432 Mem                      *memInfo;   /* meminfo to allocate for IPV6 ext hdr */
1433 #endif
1434 {
1435       
1436    /* unpack HBH hdr first */
1437    CMCHKUNPK(oduUnpackBool, &unpkParam->hbhHdrPrsnt, mBuf); 
1438    if (unpkParam->hbhHdrPrsnt)
1439       cmUnpkCmIpv6HBHHdrArr(&unpkParam->hbhOptsArr, mBuf, memInfo);         
1440                                                          
1441    /* unpack DEST opt hdr */
1442    CMCHKUNPK(oduUnpackBool, &unpkParam->destOptsPrsnt, mBuf);
1443    if (unpkParam->destOptsPrsnt)
1444       cmUnpkCmIpv6DestOptsArr(&unpkParam->destOptsArr, mBuf, memInfo);   
1445
1446    /* unpack Route hdr last */
1447    CMCHKUNPK(oduUnpackBool, &unpkParam->rtOptsPrsnt, mBuf); 
1448    if (unpkParam->rtOptsPrsnt)
1449       cmUnpkCmIpv6RtHdr(&unpkParam->rtOpts, mBuf, memInfo);  
1450                                                         
1451    return ROK;
1452 } /* end of cmUnpkCmIpv6ExtHdr */
1453
1454 \f
1455 /*
1456 *
1457 *       Fun:   cmPkCmIpv6DestOptsArr
1458 *
1459 *       Desc:  This function packs the IPV6 Destination Option array
1460 *
1461 *       Ret:   ROK
1462 *
1463 *       Notes: None
1464 *
1465 *       File:  cm_tpt.c
1466 *
1467 */
1468 #ifdef ANSI
1469 S16 cmPkCmIpv6DestOptsArr
1470 (
1471 CmIpv6DestOptsArr       *pkParam,  /* IPV6 Dest hdr array */
1472 Buffer                  *mBuf      /* message buffer */
1473 )
1474 #else
1475 S16 cmPkCmIpv6DestOptsArr (pkParam, mBuf)
1476 CmIpv6DestOptsArr       *pkParam;  /* IPV6 Dest hdr array */
1477 Buffer                  *mBuf;     /* message buffer */
1478 #endif
1479 {
1480
1481    uint8_t numOptions;
1482
1483    
1484    /* pack all HBH options */
1485    for(numOptions = 0; numOptions<pkParam->numDestOpts; numOptions++)  
1486       CMCHKPK(cmPkCmIpv6DestOptsHdr, &pkParam->destOpts[numOptions], mBuf);
1487    CMCHKPK(oduUnpackUInt8, pkParam->numDestOpts, mBuf);  
1488
1489    return ROK;
1490 } /* end of cmPkCmIpv6DestOptsArr */
1491
1492 \f
1493 /*
1494 *
1495 *       Fun:   cmPkCmIpv6DestOptsHdr
1496 *
1497 *       Desc:  This function packs individua IPV6 Destination Option
1498 *
1499 *       Ret:   ROK
1500 *
1501 *       Notes: None
1502 *
1503 *       File:  cm_tpt.c
1504 *
1505 */
1506 #ifdef ANSI
1507 S16 cmPkCmIpv6DestOptsHdr
1508 (
1509 CmIpv6DestOptsHdr       *pkParam,  /* IPV6 Dest opt */
1510 Buffer                  *mBuf      /* message buffer */
1511 )
1512 #else
1513 S16 cmPkCmIpv6DestOptsHdr (pkParam, mBuf)
1514 CmIpv6DestOptsHdr       *pkParam;  /* IPV6 Dest opt */
1515 Buffer                  *mBuf;     /* message buffer */
1516 #endif
1517 {
1518    uint8_t optLen;
1519    
1520
1521    for(optLen = 0; optLen < pkParam->length; optLen++)
1522    {
1523       CMCHKPK(oduUnpackUInt8, pkParam->value[optLen], mBuf);
1524    }
1525    CMCHKPK(oduUnpackUInt8, pkParam->length, mBuf);  
1526    CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf);  
1527
1528    return ROK;
1529 } /* end of cmPkCmIpv6DestOptsHdr */
1530
1531 \f
1532 /*
1533 *
1534 *       Fun:   cmUnpkCmIpv6DestOptsHdr
1535 *
1536 *       Desc:  This function unpacks individual IPV6 Dest Option
1537 *
1538 *       Ret:   ROK
1539 *
1540 *       Notes: None
1541 *
1542 *       File:  cm_tpt.c
1543 *
1544 */
1545 #ifdef ANSI
1546 S16 cmUnpkCmIpv6DestOptsHdr
1547 (
1548 CmIpv6DestOptsHdr       *unpkParam,/* IPV6 Dest Option */
1549 Buffer                  *mBuf,     /* message buffer */
1550 Mem                     *memInfo   /* meminfo to allocate mem for dest opt */
1551 )
1552 #else
1553 S16 cmUnpkCmIpv6DestOptsHdr (unpkParam, mBuf, memInfo)
1554 CmIpv6DestOptsHdr       *unpkParam;/* IPV6 Dest Option */
1555 Buffer                  *mBuf;     /* message buffer */
1556 Mem                     *memInfo;  /* meminfo to allocate mem for dest opt */
1557 #endif
1558 {
1559    S32 retVal;                        /* temporary return value */
1560    uint8_t optLen;                      /* length of value field */
1561
1562   
1563    /* unpack type, length */
1564    CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf);  
1565    CMCHKUNPK(oduPackUInt8, &unpkParam->length, mBuf);
1566
1567    /* allocate static memory to hold the unpacked values */
1568    retVal = SGetSBuf(memInfo->region,                   
1569                   memInfo->pool,                     
1570                   (Data **)&unpkParam->value, (Size)unpkParam->length);
1571    if (retVal != ROK)
1572    {
1573       return (ROUTRES);
1574    }
1575       
1576    /* unpack value fieldof this option */
1577    for(optLen = 0; optLen<unpkParam->length; optLen++)
1578    {
1579       CMCHKUNPK(oduPackUInt8, &unpkParam->value[optLen], mBuf);  
1580    }    
1581    
1582    return ROK;
1583 } /* end of cmUnpkCmIpv6DestOptsHdr */
1584
1585 \f
1586 /*
1587 *
1588 *       Fun:   cmUnpkCmIpv6DestOptsArr
1589 *
1590 *       Desc:  This function unpacks the IPV6 Destination Option array
1591 *
1592 *       Ret:   ROK
1593 *
1594 *       Notes: None
1595 *
1596 *       File:  cm_tpt.c
1597 *
1598 */
1599 #ifdef ANSI
1600 S16 cmUnpkCmIpv6DestOptsArr
1601 (
1602 CmIpv6DestOptsArr       *unpkParam, /* all IPV6 Destination Options */
1603 Buffer                  *mBuf,      /* message buffer */
1604 Mem                     *memInfo    /* meminfo to allocate mem for dest opts */
1605 )
1606 #else
1607 S16 cmUnpkCmIpv6DestOptsArr (unpkParam, mBuf, memInfo)
1608 CmIpv6DestOptsArr       *unpkParam; /* all IPV6 Destination Options */
1609 Buffer                  *mBuf;      /* message buffer */
1610 Mem                     *memInfo;   /* meminfo to allocate mem for dest opts */
1611 #endif
1612 {
1613    uint8_t numOptions;
1614    S16 retVal;
1615    
1616
1617    CMCHKUNPK(oduPackUInt8, &unpkParam->numDestOpts, mBuf); 
1618    if (unpkParam->numDestOpts)
1619    {
1620       /* allocate mem to hold all dest options */
1621       retVal = SGetSBuf(memInfo->region,    
1622                      memInfo->pool,                     
1623                      (Data **)&unpkParam->destOpts, 
1624                      (unpkParam->numDestOpts * sizeof(CmIpv6DestOptsHdr)));
1625       
1626       if (retVal != ROK)
1627       {
1628          return (ROUTRES);
1629       }
1630    
1631       /* unpack all dest options */
1632       for(numOptions = 0; numOptions<unpkParam->numDestOpts; numOptions++)
1633          if ((retVal = cmUnpkCmIpv6DestOptsHdr(&unpkParam->destOpts[numOptions],
1634                                             mBuf, memInfo)) != ROK)
1635             return RFAILED;   
1636    
1637    }                                             
1638    return ROK;
1639 } /* end of cmUnpkCmIpv6DestOptsArr */
1640
1641 \f
1642 /*
1643 *
1644 *       Fun:   cmPkCmIpv6HBHHdrArr
1645 *
1646 *       Desc:  This function packs the all IPV6 HopByHop options
1647 *
1648 *       Ret:   ROK
1649 *
1650 *       Notes: None
1651 *
1652 *       File:  cm_tpt.c
1653 *
1654 */
1655 #ifdef ANSI
1656 S16 cmPkCmIpv6HBHHdrArr
1657 (
1658 CmIpv6HBHHdrArr         *pkParam,  /* all IPV6 HopByHop options */
1659 Buffer                  *mBuf      /* message buffer */
1660 )
1661 #else
1662 S16 cmPkCmIpv6HBHHdrArr (pkParam, mBuf)
1663 CmIpv6HBHHdrArr         *pkParam;  /* IPV6 HopByHop options */
1664 Buffer                  *mBuf;     /* message buffer */
1665 #endif
1666 {
1667    uint8_t numOptions;
1668    
1669
1670    for(numOptions = 0; numOptions<pkParam->numHBHOpts; numOptions++)
1671       CMCHKPK(cmPkCmIpv6HBHHdr, &pkParam->hbhOpts[numOptions], mBuf);
1672                           
1673    CMCHKPK(oduUnpackUInt8, pkParam->numHBHOpts, mBuf);  
1674
1675    return ROK;
1676 } /* end of cmPkCmIpv6HBHHdrArr */
1677
1678 \f
1679 /*
1680 *
1681 *       Fun:   cmPkCmIpv6HBHHdr
1682 *
1683 *       Desc:  This function packs individual IPV6 HBH options
1684 *
1685 *       Ret:   ROK
1686 *
1687 *       Notes: None
1688 *
1689 *       File:  cm_tpt.c
1690 *
1691 */
1692 #ifdef ANSI
1693 S16 cmPkCmIpv6HBHHdr
1694 (
1695 CmIpv6HBHHdr            *pkParam,  /* individual IPV6 HBH options */
1696 Buffer                  *mBuf      /* message buffer */
1697 )
1698 #else
1699 S16 cmPkCmIpv6HBHHdr (pkParam, mBuf)
1700 CmIpv6HBHHdr            *pkParam;  /* individual IPV6 HBH options */
1701 Buffer                  *mBuf;     /* message buffer */
1702 #endif
1703 {
1704    uint8_t optLen;
1705
1706
1707    /* pack value field */
1708    for(optLen = 0; optLen<pkParam->length; optLen++)
1709    {
1710       CMCHKPK(oduUnpackUInt8, pkParam->value[optLen], mBuf);
1711    }
1712
1713    /* pack type, length fields */
1714    CMCHKPK(oduUnpackUInt8, pkParam->length, mBuf);  
1715    CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf);  
1716
1717    return ROK;
1718 } /* end of cmPkCmIpv6HBHHdr */
1719
1720 \f
1721 /*
1722 *
1723 *       Fun:   cmUnpkCmIpv6HBHHdr
1724 *
1725 *       Desc:  This function unpacks individual IPV6 HBH Option
1726 *
1727 *       Ret:   ROK
1728 *
1729 *       Notes: None
1730 *
1731 *       File:  cm_tpt.c
1732 *
1733 */
1734 #ifdef ANSI
1735 S16 cmUnpkCmIpv6HBHHdr
1736 (
1737 CmIpv6HBHHdr            *unpkParam,/* individual IPV6 HBH Option */
1738 Buffer                  *mBuf,     /* message buffer */
1739 Mem                     *memInfo   /* meminfo to allocate mem for HBH opt */
1740 )
1741 #else
1742 S16 cmUnpkCmIpv6HBHHdr (unpkParam, mBuf, memInfo)
1743 CmIpv6HBHHdr            *unpkParam;/* individual IPV6 HBH Option */
1744 Buffer                  *mBuf;     /* message buffer */
1745 Mem                     *memInfo;  /* meminfo to allocate mem for HBH opt */
1746 #endif
1747 {
1748    S32 retVal;                     /* temporary return value */
1749    uint8_t optLen;                      /* length of value field */
1750   
1751    
1752    CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf);   
1753    CMCHKUNPK(oduPackUInt8, &unpkParam->length, mBuf);
1754
1755    /* allocate static memory to hold the unpacked values */
1756    if (unpkParam->length)
1757    {
1758       retVal = SGetSBuf(memInfo->region,                   
1759                      memInfo->pool,                     
1760                      (Data **)&unpkParam->value, (Size)unpkParam->length); 
1761       if (retVal != ROK)
1762       {
1763          return (ROUTRES);
1764       }
1765
1766       for(optLen = 0; optLen<unpkParam->length; optLen++)
1767          CMCHKUNPK(oduPackUInt8, &unpkParam->value[optLen], mBuf);  
1768    } 
1769       
1770    return ROK;
1771 } /* end of cmUnpkCmIpv6HBHHdr */
1772
1773 \f
1774 /*
1775 *
1776 *       Fun:   cmUnpkCmIpv6HBHHdrArr
1777 *
1778 *       Desc:  This function unpacks all IPV6 HopByHop options
1779 *
1780 *       Ret:   ROK
1781 *
1782 *       Notes: None
1783 *
1784 *       File:  cm_tpt.c
1785 *
1786 */
1787 #ifdef ANSI
1788 S16 cmUnpkCmIpv6HBHHdrArr
1789 (
1790 CmIpv6HBHHdrArr       *unpkParam,  /* all HBH options */
1791 Buffer                *mBuf,       /* message buffer */
1792 Mem                   *memInfo     /* meminfo to allocate space for HBH opt */
1793 )
1794 #else
1795 S16 cmUnpkCmIpv6HBHHdrArr (unpkParam, mBuf, memInfo)
1796 CmIpv6HBHHdrArr       *unpkParam;  /*  all HBH options */
1797 Buffer                *mBuf;       /* message buffer */
1798 Mem                   *memInfo;    /* meminfo to allocate space for HBH opt */
1799 #endif
1800 {
1801    uint8_t numOptions; 
1802    S16 retVal;
1803
1804
1805    CMCHKUNPK(oduPackUInt8, &unpkParam->numHBHOpts, mBuf);   
1806    if (unpkParam->numHBHOpts)
1807    {
1808       /*  allocate space for all HBH options */
1809       retVal = SGetSBuf(memInfo->region,    
1810                      memInfo->pool,                     
1811                      (Data **)&unpkParam->hbhOpts, 
1812                      (unpkParam->numHBHOpts * sizeof(CmIpv6HBHHdr)));
1813       
1814       if (retVal != ROK)
1815       {
1816          return (ROUTRES);
1817       }
1818
1819       for(numOptions = 0; numOptions<unpkParam->numHBHOpts; numOptions++)
1820          cmUnpkCmIpv6HBHHdr(&unpkParam->hbhOpts[numOptions], mBuf, memInfo);
1821    }                                              
1822    return ROK;
1823 } /* end of cmUnpkCmIpv6HBHHdrArr */
1824 #endif /* IPV6_OPTS_SUPPORTED */
1825
1826 \f  
1827 /*
1828 *
1829 *       Fun:   cmUnpkCmIPHdrParm
1830 *
1831 *       Desc:  This function unpacks the IP header parameters
1832 *
1833 *       Ret:   ROK
1834 *
1835 *       Notes: None
1836 *
1837 *       File:  cm_tpt.c
1838 *
1839 */
1840 #ifdef ANSI
1841 /* added */
1842 #ifdef IPV6_OPTS_SUPPORTED
1843 S16 cmUnpkCmIpHdrParm
1844 (
1845 CmIpHdrParm              *unpkParam,/* ip hdr parameters */
1846 Buffer                   *mBuf,     /* message buffer */
1847 Mem                      *memInfo   /* meminfo to allocate mem for ipHdrParam */
1848 )
1849 #else
1850 S16 cmUnpkCmIpHdrParm
1851 (
1852 CmIpHdrParm              *unpkParam,/* ip hdr parameters */
1853 Buffer                   *mBuf     /* message buffer */
1854 )
1855 #endif /* IPV6_OPTS_SUPPORTED */
1856 #else
1857 /* added */
1858 #ifdef IPV6_OPTS_SUPPORTED
1859 S16 cmUnpkCmIpHdrParm (unpkParam, mBuf, memInfo)
1860 CmIpHdrParm              *unpkParam;/* ip hdr parameters */
1861 Buffer                   *mBuf;     /* message buffer */
1862 Mem                      *memInfo;  /* meminfo to allocate mem for ipHdrParam */
1863 #else
1864 S16 cmUnpkCmIpHdrParm (unpkParam, mBuf)
1865 CmIpHdrParm              *unpkParam;/* ip hdr parameters */
1866 Buffer                   *mBuf;     /* message buffer */
1867 #endif /* IPV6_OPTS_SUPPORTED */
1868 #endif
1869 {
1870
1871    CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf);
1872
1873    switch (unpkParam->type)
1874    {
1875       case CM_HDRPARM_NOTPRSNT:
1876       case CM_HDRPARM_ICMP6:
1877          break;
1878
1879       case CM_HDRPARM_IPV4:
1880          CMCHKUNPK(cmUnpkTknUInt8, &unpkParam->u.hdrParmIpv4.proto, mBuf);
1881          CMCHKUNPK(cmUnpkTknUInt8, &unpkParam->u.hdrParmIpv4.dfBit, mBuf);
1882          CMCHKUNPK(cmUnpkTknUInt8, &unpkParam->u.hdrParmIpv4.tos, mBuf);
1883          CMCHKUNPK(cmUnpkTknUInt8, &unpkParam->u.hdrParmIpv4.ttl, mBuf);
1884 #ifdef IPV4_OPTS_SUPPORTED
1885          CMCHKUNPK(cmUnpkTknStr64, &unpkParam->u.hdrParmIpv4.ipv4HdrOpt, mBuf);
1886 #endif /* IPV4_OPTS_SUPPORTED */
1887          break;
1888
1889       case CM_HDRPARM_IPV6:
1890 #ifdef IPV6_SUPPORTED         
1891          CMCHKUNPK(cmUnpkTknUInt8, &unpkParam->u.hdrParmIpv6.ttl, mBuf);
1892    
1893          CMCHKUNPK(cmUnpkCmNetAddr, 
1894                    &unpkParam->u.hdrParmIpv6.srcAddr6, mBuf);
1895  
1896 #ifdef IPV6_OPTS_SUPPORTED
1897          /* memInfo is passed forward to alloc mem to hold unpacked 
1898           * IPV6 etx hdr data */
1899          cmUnpkCmIpv6ExtHdr(&unpkParam->u.hdrParmIpv6.ipv6ExtHdr, 
1900                             mBuf, memInfo);
1901 #endif /* IPV6_OPTS_SUPPORTED */         
1902 #endif /* IPV6_SUPPORTED */
1903          break;
1904    
1905       default:
1906          return RFAILED;
1907    }
1908    
1909    return ROK;
1910 }   /* End of cmUnpkCmIpHdrParm */
1911
1912 \f
1913 /*
1914 *
1915 *       Fun:   cmPkCmIcmpFilter
1916 *
1917 *       Desc:  This function packs the ICMP filter parameters
1918 *
1919 *       Ret:   ROK
1920 *
1921 *       Notes: None
1922 *
1923 *       File:  cm_tpt.c
1924 *
1925 */
1926 #ifdef ANSI
1927 S16 cmPkCmIcmpFilter
1928 (
1929 CmIcmpFilter             *pkParam,   
1930 Buffer                   *mBuf       /* message buffer */
1931 )
1932 #else
1933 S16 cmPkCmIcmpFilter (pkParam, mBuf)
1934 CmIcmpFilter             *pkParam;   
1935 Buffer                   *mBuf;      /* message buffer */
1936 #endif
1937 {
1938    /* Variable declaration */
1939    S16   idx;
1940   
1941
1942    switch (pkParam->type)
1943    {
1944       case CM_ICMP_NO_FILTER:
1945          break;
1946
1947       case CM_ICMPVER4_FILTER:
1948          for(idx = (pkParam->u.icmpv4Filter.num-1); idx >= 0; idx--)
1949          {
1950             CMCHKPK(oduUnpackUInt32, pkParam->u.icmpv4Filter.icmpError[idx].errCodeMask,
1951                     mBuf);
1952             CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.icmpError[idx].errType,
1953                     mBuf);
1954          }
1955          CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.num, mBuf);
1956          CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.protocol, mBuf);
1957          CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.allMsg, mBuf);
1958          CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.icmpMsgFlag, mBuf);
1959          break;
1960
1961       case CM_ICMPVER6_FILTER:
1962      /* The structure is yet to be decided */
1963      /* CMCHKPK(cmPkCmIpv6HdrParm, &pkParam->u.ipv6HdrParm, mBuf); */
1964 #ifdef IPV6_SUPPORTED
1965          for(idx = (pkParam->u.icmpv6Filter.num - 1); idx >= 0; idx--)
1966          {
1967             CMCHKPK(oduUnpackUInt32, pkParam->u.icmpv6Filter.icmpError[idx].errCodeMask,
1968                     mBuf);
1969             CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv6Filter.icmpError[idx].errType,
1970                     mBuf);
1971          }
1972          CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv6Filter.num, mBuf);
1973          CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.allMsg, mBuf); 
1974          CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.icmpMsgFlag, mBuf);
1975 #endif /* IPV6_SUPPORTED */
1976          break;
1977    
1978       default:
1979          return RFAILED;
1980    }
1981    CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf);
1982
1983    return ROK;
1984 }
1985
1986 \f  
1987 /*
1988 *
1989 *       Fun:   cmUnpkCmIcmpFilter
1990 *
1991 *       Desc:  This function unpacks the 
1992 *
1993 *       Ret:   ROK
1994 *
1995 *       Notes: None
1996 *
1997 *       File:  cm_tpt.c
1998 *
1999 */
2000 #ifdef ANSI
2001 S16 cmUnpkCmIcmpFilter
2002 (
2003 CmIcmpFilter             *unpkParam,   
2004 Buffer                   *mBuf         /* message buffer */
2005 )
2006 #else
2007 S16 cmUnpkCmIcmpFilter (unpkParam, mBuf)
2008 CmIcmpFilter             *unpkParam;   
2009 Buffer                   *mBuf;        /* message buffer */
2010 #endif
2011 {
2012    /* Variable declaration */ 
2013    S16     idx;
2014
2015    CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf);
2016
2017    switch (unpkParam->type)
2018    {
2019       case CM_ICMP_NO_FILTER:
2020          break;
2021
2022       case CM_ICMPVER4_FILTER:
2023          CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv4Filter.icmpMsgFlag, mBuf);
2024          CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv4Filter.allMsg, mBuf);
2025          CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv4Filter.protocol, mBuf);
2026          CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv4Filter.num, mBuf);
2027
2028          for(idx = 0; idx < (unpkParam->u.icmpv4Filter.num); idx++)
2029          {
2030             CMCHKUNPK(oduPackUInt8, 
2031                       &unpkParam->u.icmpv4Filter.icmpError[idx].errType, mBuf);
2032             CMCHKUNPK(oduPackUInt32, 
2033                       &unpkParam->u.icmpv4Filter.icmpError[idx].errCodeMask, 
2034                       mBuf);
2035          }
2036          break;
2037
2038       case CM_ICMPVER6_FILTER:
2039 #ifdef IPV6_SUPPORTED
2040          CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv6Filter.icmpMsgFlag, mBuf);
2041          CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv6Filter.allMsg, mBuf); 
2042          CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv6Filter.num, mBuf);
2043
2044          for(idx = 0; idx < (unpkParam->u.icmpv6Filter.num); idx++)
2045          {
2046             CMCHKUNPK(oduPackUInt8, 
2047                       &unpkParam->u.icmpv6Filter.icmpError[idx].errType, mBuf);
2048             CMCHKUNPK(oduPackUInt32, 
2049                       &unpkParam->u.icmpv6Filter.icmpError[idx].errCodeMask, 
2050                       mBuf);
2051          }
2052 #endif /* IPV6_SUPPORTED */
2053          break;
2054    
2055       default:
2056          return RFAILED;
2057
2058    }
2059    
2060    return ROK;
2061 }   /* End of cmUnpkCmIcmpFilter */
2062
2063 #endif  /* CM_INET2 */ 
2064
2065 \f  
2066 #endif /* if(LCHCT || LCHIT || LCLHC || LCHRT || LCLHR) */
2067
2068 \f  
2069 /********************************************************************30**
2070          End of file
2071 *********************************************************************31*/