6 #include <net-snmp/net-snmp-config.h>
7 #include <net-snmp/library/asn1.h>
8 #include <net-snmp/library/snmp_impl.h>
13 croak("%s not implemented on this architecture", s);
18 constant_ASN_O(char *name, int len, int arg)
20 switch (name[5 + 0]) {
22 if (strEQ(name + 5, "BJECT_ID")) { /* ASN_O removed */
30 if (strEQ(name + 5, "CTET_STR")) { /* ASN_O removed */
38 if (strEQ(name + 5, "PAQUE")) { /* ASN_O removed */
55 constant_ASN_B(char *name, int len, int arg)
57 switch (name[5 + 0]) {
59 if (strEQ(name + 5, "IT_STR")) { /* ASN_B removed */
67 if (strEQ(name + 5, "OOLEAN")) { /* ASN_B removed */
84 constant_ASN_S(char *name, int len, int arg)
90 switch (name[5 + 1]) {
92 if (strEQ(name + 5, "EQUENCE")) { /* ASN_S removed */
100 if (strEQ(name + 5, "ET")) { /* ASN_S removed */
117 constant_ASN_C(char *name, int len, int arg)
123 switch (name[5 + 6]) {
125 if (strEQ(name + 5, "OUNTER")) { /* ASN_C removed */
133 if (strEQ(name + 5, "OUNTER64")) { /* ASN_C removed */
135 return ASN_COUNTER64;
150 constant_ASN_U(char *name, int len, int arg)
156 switch (name[5 + 7]) {
158 if (strEQ(name + 5, "NSIGNED")) { /* ASN_U removed */
166 if (strEQ(name + 5, "NSIGNED64")) { /* ASN_U removed */
167 #ifdef ASN_UNSIGNED64
168 return ASN_UNSIGNED64;
183 constant_ASN_IN(char *name, int len, int arg)
189 switch (name[6 + 5]) {
191 if (strEQ(name + 6, "TEGER")) { /* ASN_IN removed */
199 if (strEQ(name + 6, "TEGER64")) { /* ASN_IN removed */
201 return ASN_INTEGER64;
216 constant_ASN_I(char *name, int len, int arg)
218 switch (name[5 + 0]) {
220 return constant_ASN_IN(name, len, arg);
222 if (strEQ(name + 5, "PADDRESS")) { /* ASN_I removed */
224 return ASN_IPADDRESS;
239 constant(char *name, int len, int arg)
246 switch (name[0 + 4]) {
248 if (strEQ(name + 0, "ASN_APPLICATION")) { /* removed */
249 #ifdef ASN_APPLICATION
250 return ASN_APPLICATION;
256 if (!strnEQ(name + 0,"ASN_", 4))
258 return constant_ASN_B(name, len, arg);
260 if (!strnEQ(name + 0,"ASN_", 4))
262 return constant_ASN_C(name, len, arg);
264 if (strEQ(name + 0, "ASN_DOUBLE")) { /* removed */
272 if (strEQ(name + 0, "ASN_FLOAT")) { /* removed */
280 if (strEQ(name + 0, "ASN_GAUGE")) { /* removed */
288 if (!strnEQ(name + 0,"ASN_", 4))
290 return constant_ASN_I(name, len, arg);
292 if (strEQ(name + 0, "ASN_NULL")) { /* removed */
300 if (!strnEQ(name + 0,"ASN_", 4))
302 return constant_ASN_O(name, len, arg);
304 if (!strnEQ(name + 0,"ASN_", 4))
306 return constant_ASN_S(name, len, arg);
308 if (strEQ(name + 0, "ASN_TIMETICKS")) { /* removed */
310 return ASN_TIMETICKS;
316 if (!strnEQ(name + 0,"ASN_", 4))
318 return constant_ASN_U(name, len, arg);
329 MODULE = NetSNMP::ASN PACKAGE = NetSNMP::ASN
338 char * s = SvPV(sv, len);
341 RETVAL = constant(s,len,arg);