]> git.stg.codes - stg.git/blob - stglibs/smux.lib/TcpConnEntry.c
New usage message.
[stg.git] / stglibs / smux.lib / TcpConnEntry.c
1 /*
2  * Generated by asn1c-0.9.21 (http://lionet.info/asn1c)
3  * From ASN.1 module "RFC1213-MIB"
4  *      found in "RFC1213-MIB.asn1"
5  *      `asn1c -fskeletons-copy`
6  */
7
8 #include <asn_internal.h>
9
10 #include "TcpConnEntry.h"
11
12 static int
13 memb_tcpConnLocalPort_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
14                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
15         long value;
16         
17         if(!sptr) {
18                 _ASN_CTFAIL(app_key, td, sptr,
19                         "%s: value not given (%s:%d)",
20                         td->name, __FILE__, __LINE__);
21                 return -1;
22         }
23         
24         value = *(const long *)sptr;
25         
26         if((value >= 0 && value <= 65535)) {
27                 /* Constraint check succeeded */
28                 return 0;
29         } else {
30                 _ASN_CTFAIL(app_key, td, sptr,
31                         "%s: constraint failed (%s:%d)",
32                         td->name, __FILE__, __LINE__);
33                 return -1;
34         }
35 }
36
37 static int
38 memb_tcpConnRemPort_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
39                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
40         long value;
41         
42         if(!sptr) {
43                 _ASN_CTFAIL(app_key, td, sptr,
44                         "%s: value not given (%s:%d)",
45                         td->name, __FILE__, __LINE__);
46                 return -1;
47         }
48         
49         value = *(const long *)sptr;
50         
51         if((value >= 0 && value <= 65535)) {
52                 /* Constraint check succeeded */
53                 return 0;
54         } else {
55                 _ASN_CTFAIL(app_key, td, sptr,
56                         "%s: constraint failed (%s:%d)",
57                         td->name, __FILE__, __LINE__);
58                 return -1;
59         }
60 }
61
62 static asn_TYPE_member_t asn_MBR_TcpConnEntry_1[] = {
63         { ATF_NOFLAGS, 0, offsetof(struct TcpConnEntry, tcpConnState),
64                 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
65                 0,
66                 &asn_DEF_INTEGER,
67                 0,      /* Defer constraints checking to the member type */
68                 0,      /* PER is not compiled, use -gen-PER */
69                 0,
70                 "tcpConnState"
71                 },
72         { ATF_NOFLAGS, 0, offsetof(struct TcpConnEntry, tcpConnLocalAddress),
73                 (ASN_TAG_CLASS_APPLICATION | (0 << 2)),
74                 0,
75                 &asn_DEF_IpAddress,
76                 0,      /* Defer constraints checking to the member type */
77                 0,      /* PER is not compiled, use -gen-PER */
78                 0,
79                 "tcpConnLocalAddress"
80                 },
81         { ATF_NOFLAGS, 0, offsetof(struct TcpConnEntry, tcpConnLocalPort),
82                 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
83                 0,
84                 &asn_DEF_NativeInteger,
85                 memb_tcpConnLocalPort_constraint_1,
86                 0,      /* PER is not compiled, use -gen-PER */
87                 0,
88                 "tcpConnLocalPort"
89                 },
90         { ATF_NOFLAGS, 0, offsetof(struct TcpConnEntry, tcpConnRemAddress),
91                 (ASN_TAG_CLASS_APPLICATION | (0 << 2)),
92                 0,
93                 &asn_DEF_IpAddress,
94                 0,      /* Defer constraints checking to the member type */
95                 0,      /* PER is not compiled, use -gen-PER */
96                 0,
97                 "tcpConnRemAddress"
98                 },
99         { ATF_NOFLAGS, 0, offsetof(struct TcpConnEntry, tcpConnRemPort),
100                 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
101                 0,
102                 &asn_DEF_NativeInteger,
103                 memb_tcpConnRemPort_constraint_1,
104                 0,      /* PER is not compiled, use -gen-PER */
105                 0,
106                 "tcpConnRemPort"
107                 },
108 };
109 static ber_tlv_tag_t asn_DEF_TcpConnEntry_tags_1[] = {
110         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
111 };
112 static asn_TYPE_tag2member_t asn_MAP_TcpConnEntry_tag2el_1[] = {
113     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* tcpConnState at 236 */
114     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* tcpConnLocalPort at 240 */
115     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -2, 0 }, /* tcpConnRemPort at 244 */
116     { (ASN_TAG_CLASS_APPLICATION | (0 << 2)), 1, 0, 1 }, /* tcpConnLocalAddress at 238 */
117     { (ASN_TAG_CLASS_APPLICATION | (0 << 2)), 3, -1, 0 } /* tcpConnRemAddress at 242 */
118 };
119 static asn_SEQUENCE_specifics_t asn_SPC_TcpConnEntry_specs_1 = {
120         sizeof(struct TcpConnEntry),
121         offsetof(struct TcpConnEntry, _asn_ctx),
122         asn_MAP_TcpConnEntry_tag2el_1,
123         5,      /* Count of tags in the map */
124         0, 0, 0,        /* Optional elements (not needed) */
125         -1,     /* Start extensions */
126         -1      /* Stop extensions */
127 };
128 asn_TYPE_descriptor_t asn_DEF_TcpConnEntry = {
129         "TcpConnEntry",
130         "TcpConnEntry",
131         SEQUENCE_free,
132         SEQUENCE_print,
133         SEQUENCE_constraint,
134         SEQUENCE_decode_ber,
135         SEQUENCE_encode_der,
136         SEQUENCE_decode_xer,
137         SEQUENCE_encode_xer,
138         0, 0,   /* No PER support, use "-gen-PER" to enable */
139         0,      /* Use generic outmost tag fetcher */
140         asn_DEF_TcpConnEntry_tags_1,
141         sizeof(asn_DEF_TcpConnEntry_tags_1)
142                 /sizeof(asn_DEF_TcpConnEntry_tags_1[0]), /* 1 */
143         asn_DEF_TcpConnEntry_tags_1,    /* Same as above */
144         sizeof(asn_DEF_TcpConnEntry_tags_1)
145                 /sizeof(asn_DEF_TcpConnEntry_tags_1[0]), /* 1 */
146         0,      /* No PER visible constraints */
147         asn_MBR_TcpConnEntry_1,
148         5,      /* Elements count */
149         &asn_SPC_TcpConnEntry_specs_1   /* Additional specs */
150 };
151