]> git.stg.codes - stg.git/blob - libs/smux/IpAddress.c
Use std::lock_guard instead of STG_LOCKER.
[stg.git] / libs / smux / IpAddress.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "RFC1155-SMI"
4  *      found in "RFC1155-SMI.asn1"
5  *      `asn1c -S /home/faust/software/asn1c/skeletons/ -fcompound-names -fwide-types`
6  */
7
8 #include "IpAddress.h"
9
10 int
11 IpAddress_constraint(const 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;
15         
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;
21         }
22         
23         size = st->size;
24         
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;
33         }
34 }
35
36 /*
37  * This type is implemented using OCTET_STRING,
38  * so here we adjust the DEF accordingly.
39  */
40 static asn_oer_constraints_t asn_OER_type_IpAddress_constr_1 CC_NOTUSED = {
41         { 0, 0 },
42         4       /* (SIZE(4..4)) */};
43 asn_per_constraints_t asn_PER_type_IpAddress_constr_1 CC_NOTUSED = {
44         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
45         { APC_CONSTRAINED,       0,  0,  4,  4 }        /* (SIZE(4..4)) */,
46         0, 0    /* No PER value map */
47 };
48 static const ber_tlv_tag_t asn_DEF_IpAddress_tags_1[] = {
49         (ASN_TAG_CLASS_APPLICATION | (0 << 2)),
50         (ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
51 };
52 asn_TYPE_descriptor_t asn_DEF_IpAddress = {
53         "IpAddress",
54         "IpAddress",
55         &asn_OP_OCTET_STRING,
56         asn_DEF_IpAddress_tags_1,
57         sizeof(asn_DEF_IpAddress_tags_1)
58                 /sizeof(asn_DEF_IpAddress_tags_1[0]) - 1, /* 1 */
59         asn_DEF_IpAddress_tags_1,       /* Same as above */
60         sizeof(asn_DEF_IpAddress_tags_1)
61                 /sizeof(asn_DEF_IpAddress_tags_1[0]), /* 2 */
62         { &asn_OER_type_IpAddress_constr_1, &asn_PER_type_IpAddress_constr_1, IpAddress_constraint },
63         0, 0,   /* No members */
64         &asn_SPC_OCTET_STRING_specs     /* Additional specs */
65 };
66