ITS
ItsPduHeader.c
Go to the documentation of this file.
1 /*
2  * Generated by asn1c-0.9.27 (http://lionet.info/asn1c)
3  * From ASN.1 module "ITS-Container"
4  * found in "ITS-Container.asn"
5  */
6 
7 #include "ItsPduHeader.h"
8 
9 static int
11  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
12  long value;
13 
14  if(!sptr) {
15  _ASN_CTFAIL(app_key, td, sptr,
16  "%s: value not given (%s:%d)",
17  td->name, __FILE__, __LINE__);
18  return -1;
19  }
20 
21  value = *(const long *)sptr;
22 
23  if((value >= 0 && value <= 255)) {
24  /* Constraint check succeeded */
25  return 0;
26  } else {
27  _ASN_CTFAIL(app_key, td, sptr,
28  "%s: constraint failed (%s:%d)",
29  td->name, __FILE__, __LINE__);
30  return -1;
31  }
32 }
33 
34 static int
36  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
37  long value;
38 
39  if(!sptr) {
40  _ASN_CTFAIL(app_key, td, sptr,
41  "%s: value not given (%s:%d)",
42  td->name, __FILE__, __LINE__);
43  return -1;
44  }
45 
46  value = *(const long *)sptr;
47 
48  if((value >= 0 && value <= 255)) {
49  /* Constraint check succeeded */
50  return 0;
51  } else {
52  _ASN_CTFAIL(app_key, td, sptr,
53  "%s: constraint failed (%s:%d)",
54  td->name, __FILE__, __LINE__);
55  return -1;
56  }
57 }
58 
59 static asn_per_constraints_t asn_PER_memb_protocolVersion_constr_2 GCC_NOTUSED = {
60  { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */,
61  { APC_UNCONSTRAINED, -1, -1, 0, 0 },
62  0, 0 /* No PER value map */
63 };
64 static asn_per_constraints_t asn_PER_memb_messageID_constr_4 GCC_NOTUSED = {
65  { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */,
66  { APC_UNCONSTRAINED, -1, -1, 0, 0 },
67  0, 0 /* No PER value map */
68 };
71  (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
72  -1, /* IMPLICIT tag at current level */
75  &asn_PER_memb_protocolVersion_constr_2,
76  0,
77  "protocolVersion"
78  },
80  (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
81  -1, /* IMPLICIT tag at current level */
84  &asn_PER_memb_messageID_constr_4,
85  0,
86  "messageID"
87  },
88  { ATF_NOFLAGS, 0, offsetof(struct ItsPduHeader, stationID),
89  (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
90  -1, /* IMPLICIT tag at current level */
92  0, /* Defer constraints checking to the member type */
93  0, /* No PER visible constraints */
94  0,
95  "stationID"
96  },
97 };
99  (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
100 };
102  { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* protocolVersion */
103  { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* messageID */
104  { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* stationID */
105 };
107  sizeof(struct ItsPduHeader),
108  offsetof(struct ItsPduHeader, _asn_ctx),
110  3, /* Count of tags in the map */
111  0, 0, 0, /* Optional elements (not needed) */
112  -1, /* Start extensions */
113  -1 /* Stop extensions */
114 };
116  "ItsPduHeader",
117  "ItsPduHeader",
127  0, /* Use generic outmost tag fetcher */
130  /sizeof(asn_DEF_ItsPduHeader_tags_1[0]), /* 1 */
131  asn_DEF_ItsPduHeader_tags_1, /* Same as above */
133  /sizeof(asn_DEF_ItsPduHeader_tags_1[0]), /* 1 */
134  0, /* No PER visible constraints */
136  3, /* Elements count */
137  &asn_SPC_ItsPduHeader_specs_1 /* Additional specs */
138 };
139 
asn_struct_ctx_t _asn_ctx
Definition: ItsPduHeader.h:43
#define offsetof(s, m)
Definition: asn_system.h:115
messageID
Definition: ItsPduHeader.h:26
ber_type_decoder_f SEQUENCE_decode_ber
static int memb_protocolVersion_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key)
Definition: ItsPduHeader.c:10
protocolVersion
Definition: ItsPduHeader.h:23
der_type_encoder_f SEQUENCE_encode_der
asn_TYPE_descriptor_t asn_DEF_ItsPduHeader
Definition: ItsPduHeader.c:115
asn_struct_print_f SEQUENCE_print
per_type_decoder_f SEQUENCE_decode_uper
per_type_encoder_f SEQUENCE_encode_uper
asn_constr_check_f SEQUENCE_constraint
xer_type_decoder_f SEQUENCE_decode_xer
asn_TYPE_descriptor_t asn_DEF_NativeInteger
Definition: NativeInteger.c:22
asn_struct_free_f SEQUENCE_free
static ber_tlv_tag_t asn_DEF_ItsPduHeader_tags_1[]
Definition: ItsPduHeader.c:98
static asn_TYPE_tag2member_t asn_MAP_ItsPduHeader_tag2el_1[]
Definition: ItsPduHeader.c:101
static asn_per_constraints_t asn_PER_memb_protocolVersion_constr_2 GCC_NOTUSED
Definition: ItsPduHeader.c:59
static asn_SEQUENCE_specifics_t asn_SPC_ItsPduHeader_specs_1
Definition: ItsPduHeader.c:106
static int memb_messageID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key)
Definition: ItsPduHeader.c:35
asn_TYPE_descriptor_t asn_DEF_StationID
Definition: StationID.c:119
void() asn_app_constraint_failed_f(void *application_specific_key, struct asn_TYPE_descriptor_s *type_descriptor_which_failed, const void *structure_which_failed_ptr, const char *error_message_format,...) GCC_PRINTFLIKE(4
xer_type_encoder_f SEQUENCE_encode_xer
#define _ASN_CTFAIL
Definition: constraints.h:57
unsigned ber_tlv_tag_t
Definition: ber_tlv_tag.h:18
static asn_TYPE_member_t asn_MBR_ItsPduHeader_1[]
Definition: ItsPduHeader.c:69