remark release date
[Net-Radio-Location-SUPL-Test.git] / asn1 / IPAddress.c
blobc966a322fc71a2bc14463706240c457294a81649
1 /*
2 * Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
3 * From ASN.1 module "ULP-Components"
4 * found in "../asn1src/ULP-Components.asn"
5 * `asn1c -gen-PER -fskeletons-copy -fnative-types`
6 */
8 #include "IPAddress.h"
10 static int
11 memb_ipv4Address_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
14 size_t size;
16 if(!sptr) {
17 _ASN_CTFAIL(app_key, td, sptr,
18 "%s: value not given (%s:%d)",
19 td->name, __FILE__, __LINE__);
20 return -1;
23 size = st->size;
25 if((size == 4)) {
26 /* Constraint check succeeded */
27 return 0;
28 } else {
29 _ASN_CTFAIL(app_key, td, sptr,
30 "%s: constraint failed (%s:%d)",
31 td->name, __FILE__, __LINE__);
32 return -1;
36 static int
37 memb_ipv6Address_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
38 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
39 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
40 size_t size;
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;
49 size = st->size;
51 if((size == 16)) {
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;
62 static asn_per_constraints_t asn_PER_memb_ipv4Address_constr_2 = {
63 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
64 { APC_CONSTRAINED, 0, 0, 4, 4 } /* (SIZE(4..4)) */,
65 0, 0 /* No PER value map */
67 static asn_per_constraints_t asn_PER_memb_ipv6Address_constr_3 = {
68 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
69 { APC_CONSTRAINED, 0, 0, 16, 16 } /* (SIZE(16..16)) */,
70 0, 0 /* No PER value map */
72 static asn_per_constraints_t asn_PER_type_IPAddress_constr_1 = {
73 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
74 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
75 0, 0 /* No PER value map */
77 static asn_TYPE_member_t asn_MBR_IPAddress_1[] = {
78 { ATF_NOFLAGS, 0, offsetof(struct IPAddress, choice.ipv4Address),
79 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
80 -1, /* IMPLICIT tag at current level */
81 &asn_DEF_OCTET_STRING,
82 memb_ipv4Address_constraint_1,
83 &asn_PER_memb_ipv4Address_constr_2,
85 "ipv4Address"
87 { ATF_NOFLAGS, 0, offsetof(struct IPAddress, choice.ipv6Address),
88 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
89 -1, /* IMPLICIT tag at current level */
90 &asn_DEF_OCTET_STRING,
91 memb_ipv6Address_constraint_1,
92 &asn_PER_memb_ipv6Address_constr_3,
94 "ipv6Address"
97 static asn_TYPE_tag2member_t asn_MAP_IPAddress_tag2el_1[] = {
98 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ipv4Address at 41 */
99 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ipv6Address at 42 */
101 static asn_CHOICE_specifics_t asn_SPC_IPAddress_specs_1 = {
102 sizeof(struct IPAddress),
103 offsetof(struct IPAddress, _asn_ctx),
104 offsetof(struct IPAddress, present),
105 sizeof(((struct IPAddress *)0)->present),
106 asn_MAP_IPAddress_tag2el_1,
107 2, /* Count of tags in the map */
109 -1 /* Extensions start */
111 asn_TYPE_descriptor_t asn_DEF_IPAddress = {
112 "IPAddress",
113 "IPAddress",
114 CHOICE_free,
115 CHOICE_print,
116 CHOICE_constraint,
117 CHOICE_decode_ber,
118 CHOICE_encode_der,
119 CHOICE_decode_xer,
120 CHOICE_encode_xer,
121 CHOICE_decode_uper,
122 CHOICE_encode_uper,
123 CHOICE_outmost_tag,
124 0, /* No effective tags (pointer) */
125 0, /* No effective tags (count) */
126 0, /* No tags (pointer) */
127 0, /* No tags (count) */
128 &asn_PER_type_IPAddress_constr_1,
129 asn_MBR_IPAddress_1,
130 2, /* Elements count */
131 &asn_SPC_IPAddress_specs_1 /* Additional specs */