~paulliu/ubuntu/quantal/freerdp/fixext

« back to all changes in this revision

Viewing changes to asn1/NegTokenResp.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-01-31 10:02:14 UTC
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20120131100214-zvig71djj2sqgq22
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Generated by asn1c-0.9.22.1409 (http://lionet.info/asn1c)
3
 
 * From ASN.1 module "SPNEGO"
4
 
 *      found in "spnego.asn1"
5
 
 *      `asn1c -fnative-types -fskeletons-copy -fcompound-names`
6
 
 */
7
 
 
8
 
#include <asn_internal.h>
9
 
 
10
 
#include "NegTokenResp.h"
11
 
 
12
 
static int
13
 
negState_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
14
 
                        asn_app_constraint_failed_f *ctfailcb, void *app_key) {
15
 
        /* Replace with underlying type checker */
16
 
        td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
17
 
        return td->check_constraints(td, sptr, ctfailcb, app_key);
18
 
}
19
 
 
20
 
/*
21
 
 * This type is implemented using NativeEnumerated,
22
 
 * so here we adjust the DEF accordingly.
23
 
 */
24
 
static void
25
 
negState_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
26
 
        td->free_struct    = asn_DEF_NativeEnumerated.free_struct;
27
 
        td->print_struct   = asn_DEF_NativeEnumerated.print_struct;
28
 
        td->ber_decoder    = asn_DEF_NativeEnumerated.ber_decoder;
29
 
        td->der_encoder    = asn_DEF_NativeEnumerated.der_encoder;
30
 
        td->xer_decoder    = asn_DEF_NativeEnumerated.xer_decoder;
31
 
        td->xer_encoder    = asn_DEF_NativeEnumerated.xer_encoder;
32
 
        td->uper_decoder   = asn_DEF_NativeEnumerated.uper_decoder;
33
 
        td->uper_encoder   = asn_DEF_NativeEnumerated.uper_encoder;
34
 
        if(!td->per_constraints)
35
 
                td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
36
 
        td->elements       = asn_DEF_NativeEnumerated.elements;
37
 
        td->elements_count = asn_DEF_NativeEnumerated.elements_count;
38
 
     /* td->specifics      = asn_DEF_NativeEnumerated.specifics;        // Defined explicitly */
39
 
}
40
 
 
41
 
static void
42
 
negState_2_free(asn_TYPE_descriptor_t *td,
43
 
                void *struct_ptr, int contents_only) {
44
 
        negState_2_inherit_TYPE_descriptor(td);
45
 
        td->free_struct(td, struct_ptr, contents_only);
46
 
}
47
 
 
48
 
static int
49
 
negState_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
50
 
                int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
51
 
        negState_2_inherit_TYPE_descriptor(td);
52
 
        return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
53
 
}
54
 
 
55
 
static asn_dec_rval_t
56
 
negState_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
57
 
                void **structure, const void *bufptr, size_t size, int tag_mode) {
58
 
        negState_2_inherit_TYPE_descriptor(td);
59
 
        return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
60
 
}
61
 
 
62
 
static asn_enc_rval_t
63
 
negState_2_encode_der(asn_TYPE_descriptor_t *td,
64
 
                void *structure, int tag_mode, ber_tlv_tag_t tag,
65
 
                asn_app_consume_bytes_f *cb, void *app_key) {
66
 
        negState_2_inherit_TYPE_descriptor(td);
67
 
        return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
68
 
}
69
 
 
70
 
static asn_dec_rval_t
71
 
negState_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
72
 
                void **structure, const char *opt_mname, const void *bufptr, size_t size) {
73
 
        negState_2_inherit_TYPE_descriptor(td);
74
 
        return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
75
 
}
76
 
 
77
 
static asn_enc_rval_t
78
 
negState_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
79
 
                int ilevel, enum xer_encoder_flags_e flags,
80
 
                asn_app_consume_bytes_f *cb, void *app_key) {
81
 
        negState_2_inherit_TYPE_descriptor(td);
82
 
        return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
83
 
}
84
 
 
85
 
static asn_INTEGER_enum_map_t asn_MAP_negState_value2enum_2[] = {
86
 
        { 0,    16,     "accept-completed" },
87
 
        { 1,    17,     "accept-incomplete" },
88
 
        { 2,    6,      "reject" },
89
 
        { 3,    11,     "request-mic" }
90
 
};
91
 
static unsigned int asn_MAP_negState_enum2value_2[] = {
92
 
        0,      /* accept-completed(0) */
93
 
        1,      /* accept-incomplete(1) */
94
 
        2,      /* reject(2) */
95
 
        3       /* request-mic(3) */
96
 
};
97
 
static asn_INTEGER_specifics_t asn_SPC_negState_specs_2 = {
98
 
        asn_MAP_negState_value2enum_2,  /* "tag" => N; sorted by tag */
99
 
        asn_MAP_negState_enum2value_2,  /* N => "tag"; sorted by N */
100
 
        4,      /* Number of elements in the maps */
101
 
        0,      /* Enumeration is not extensible */
102
 
        1,      /* Strict enumeration */
103
 
        0,      /* Native long size */
104
 
        0
105
 
};
106
 
static ber_tlv_tag_t asn_DEF_negState_tags_2[] = {
107
 
        (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
108
 
        (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
109
 
};
110
 
static /* Use -fall-defs-global to expose */
111
 
asn_TYPE_descriptor_t asn_DEF_negState_2 = {
112
 
        "negState",
113
 
        "negState",
114
 
        negState_2_free,
115
 
        negState_2_print,
116
 
        negState_2_constraint,
117
 
        negState_2_decode_ber,
118
 
        negState_2_encode_der,
119
 
        negState_2_decode_xer,
120
 
        negState_2_encode_xer,
121
 
        0, 0,   /* No PER support, use "-gen-PER" to enable */
122
 
        0,      /* Use generic outmost tag fetcher */
123
 
        asn_DEF_negState_tags_2,
124
 
        sizeof(asn_DEF_negState_tags_2)
125
 
                /sizeof(asn_DEF_negState_tags_2[0]), /* 2 */
126
 
        asn_DEF_negState_tags_2,        /* Same as above */
127
 
        sizeof(asn_DEF_negState_tags_2)
128
 
                /sizeof(asn_DEF_negState_tags_2[0]), /* 2 */
129
 
        0,      /* No PER visible constraints */
130
 
        0, 0,   /* Defined elsewhere */
131
 
        &asn_SPC_negState_specs_2       /* Additional specs */
132
 
};
133
 
 
134
 
static asn_TYPE_member_t asn_MBR_NegTokenResp_1[] = {
135
 
        { ATF_POINTER, 4, offsetof(struct NegTokenResp, negState),
136
 
                (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
137
 
                +1,     /* EXPLICIT tag at current level */
138
 
                &asn_DEF_negState_2,
139
 
                0,      /* Defer constraints checking to the member type */
140
 
                0,      /* PER is not compiled, use -gen-PER */
141
 
                0,
142
 
                "negState"
143
 
                },
144
 
        { ATF_POINTER, 3, offsetof(struct NegTokenResp, supportedMech),
145
 
                (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
146
 
                +1,     /* EXPLICIT tag at current level */
147
 
                &asn_DEF_MechType,
148
 
                0,      /* Defer constraints checking to the member type */
149
 
                0,      /* PER is not compiled, use -gen-PER */
150
 
                0,
151
 
                "supportedMech"
152
 
                },
153
 
        { ATF_POINTER, 2, offsetof(struct NegTokenResp, responseToken),
154
 
                (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
155
 
                +1,     /* EXPLICIT tag at current level */
156
 
                &asn_DEF_OCTET_STRING,
157
 
                0,      /* Defer constraints checking to the member type */
158
 
                0,      /* PER is not compiled, use -gen-PER */
159
 
                0,
160
 
                "responseToken"
161
 
                },
162
 
        { ATF_POINTER, 1, offsetof(struct NegTokenResp, mechListMIC),
163
 
                (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
164
 
                +1,     /* EXPLICIT tag at current level */
165
 
                &asn_DEF_OCTET_STRING,
166
 
                0,      /* Defer constraints checking to the member type */
167
 
                0,      /* PER is not compiled, use -gen-PER */
168
 
                0,
169
 
                "mechListMIC"
170
 
                },
171
 
};
172
 
static ber_tlv_tag_t asn_DEF_NegTokenResp_tags_1[] = {
173
 
        (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
174
 
};
175
 
static asn_TYPE_tag2member_t asn_MAP_NegTokenResp_tag2el_1[] = {
176
 
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* negState at 46 */
177
 
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* supportedMech at 51 */
178
 
    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* responseToken at 52 */
179
 
    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* mechListMIC at 53 */
180
 
};
181
 
static asn_SEQUENCE_specifics_t asn_SPC_NegTokenResp_specs_1 = {
182
 
        sizeof(struct NegTokenResp),
183
 
        offsetof(struct NegTokenResp, _asn_ctx),
184
 
        asn_MAP_NegTokenResp_tag2el_1,
185
 
        4,      /* Count of tags in the map */
186
 
        0, 0, 0,        /* Optional elements (not needed) */
187
 
        -1,     /* Start extensions */
188
 
        -1      /* Stop extensions */
189
 
};
190
 
asn_TYPE_descriptor_t asn_DEF_NegTokenResp = {
191
 
        "NegTokenResp",
192
 
        "NegTokenResp",
193
 
        SEQUENCE_free,
194
 
        SEQUENCE_print,
195
 
        SEQUENCE_constraint,
196
 
        SEQUENCE_decode_ber,
197
 
        SEQUENCE_encode_der,
198
 
        SEQUENCE_decode_xer,
199
 
        SEQUENCE_encode_xer,
200
 
        0, 0,   /* No PER support, use "-gen-PER" to enable */
201
 
        0,      /* Use generic outmost tag fetcher */
202
 
        asn_DEF_NegTokenResp_tags_1,
203
 
        sizeof(asn_DEF_NegTokenResp_tags_1)
204
 
                /sizeof(asn_DEF_NegTokenResp_tags_1[0]), /* 1 */
205
 
        asn_DEF_NegTokenResp_tags_1,    /* Same as above */
206
 
        sizeof(asn_DEF_NegTokenResp_tags_1)
207
 
                /sizeof(asn_DEF_NegTokenResp_tags_1[0]), /* 1 */
208
 
        0,      /* No PER visible constraints */
209
 
        asn_MBR_NegTokenResp_1,
210
 
        4,      /* Elements count */
211
 
        &asn_SPC_NegTokenResp_specs_1   /* Additional specs */
212
 
};
213