Debian Codegraph @

perl/ASN/ASN.pm

raw
1 package NetSNMP::ASN;
2
3 use strict;
4 use warnings;
5 use Carp;
6
7 require Exporter;
8 require DynaLoader;
9 use AutoLoader;
10
11 use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION $AUTOLOAD);
12
13 @ISA = qw(Exporter DynaLoader);
14
15 # Items to export into callers namespace by default. Note: do not export
16 # names by default without a very good reason. Use EXPORT_OK instead.
17 # Do not simply export all your public functions/methods/constants.
18
19 # This allows declaration use NetSNMP::ASN ':all';
20 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
21 # will save memory.
22 %EXPORT_TAGS = ( 'all' => [ qw(
23 ASN_APPLICATION
24 ASN_BIT_STR
25 ASN_BOOLEAN
26 ASN_COUNTER
27 ASN_COUNTER64
28 ASN_DOUBLE
29 ASN_FLOAT
30 ASN_GAUGE
31 ASN_INTEGER
32 ASN_INTEGER64
33 ASN_IPADDRESS
34 ASN_NULL
35 ASN_OBJECT_ID
36 ASN_OCTET_STR
37 ASN_OPAQUE
38 ASN_SEQUENCE
39 ASN_SET
40 ASN_TIMETICKS
41 ASN_UNSIGNED
42 ASN_UNSIGNED64
43 ) ] );
44
45 @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
46
47 @EXPORT = qw(
48 ASN_APPLICATION
49 ASN_BIT_STR
50 ASN_BOOLEAN
51 ASN_COUNTER
52 ASN_COUNTER64
53 ASN_DOUBLE
54 ASN_FLOAT
55 ASN_GAUGE
56 ASN_INTEGER
57 ASN_INTEGER64
58 ASN_IPADDRESS
59 ASN_NULL
60 ASN_OBJECT_ID
61 ASN_OCTET_STR
62 ASN_OPAQUE
63 ASN_SEQUENCE
64 ASN_SET
65 ASN_TIMETICKS
66 ASN_UNSIGNED
67 ASN_UNSIGNED64
68 );
69 $VERSION = '5.09052';
70
71 sub AUTOLOAD {
72 # This AUTOLOAD is used to 'autoload' constants from the constant()
73 # XS function. If a constant is not found then control is passed
74 # to the AUTOLOAD in AutoLoader.
75
76 my $constname;
77 ($constname = $AUTOLOAD) =~ s/.*:://;
78 croak "& not defined" if $constname eq 'constant';
79 my $val;
80 ($!, $val) = constant($constname);
81 if ($! != 0) {
82 if ($! =~ /Invalid/ || $!{EINVAL}) {
83 $AutoLoader::AUTOLOAD = $AUTOLOAD;
84 goto &AutoLoader::AUTOLOAD;
85 }
86 else {
87 croak "Your vendor has not defined NetSNMP::ASN macro $constname";
88 }
89 }
90 {
91 no strict 'refs';
92 # Fixed between 5.005_53 and 5.005_61
93 # if ($] >= 5.00561) {
94 # *$AUTOLOAD = sub () { $val };
95 # }
96 # else {
97 *$AUTOLOAD = sub { $val };
98 # }
99 }
100 goto &$AUTOLOAD;
101 }
102
103 bootstrap NetSNMP::ASN $VERSION;
104
105 # Preloaded methods go here.
106
107 # Autoload methods go after =cut, and are processed by the autosplit program.
108
109 1;
110 __END__
111
112 =head1 NAME
113
114 NetSNMP::ASN - Perl extension for SNMP ASN.1 types
115
116 =head1 SYNOPSIS
117
118 use NetSNMP::ASN qw(:all);
119 my $asn_int = ASN_INTEGER;
120
121 =head1 DESCRIPTION
122
123 The NetSNMP::ASN module provides the ASN.1 types for SNMP.
124
125 =head2 EXPORT
126
127 None by default.
128
129 =head2 Exportable constants
130
131 ASN_APPLICATION
132 ASN_BIT_STR
133 ASN_BOOLEAN
134 ASN_COUNTER
135 ASN_COUNTER64
136 ASN_DOUBLE
137 ASN_FLOAT
138 ASN_GAUGE
139 ASN_INTEGER
140 ASN_INTEGER64
141 ASN_IPADDRESS
142 ASN_NULL
143 ASN_OBJECT_ID
144 ASN_OCTET_STR
145 ASN_OPAQUE
146 ASN_SEQUENCE
147 ASN_SET
148 ASN_TIMETICKS
149 ASN_UNSIGNED
150 ASN_UNSIGNED64
151
152
153 =head1 AUTHOR
154
155 Wes Hardaker, E<lt>[email protected]<gt>
156
157 =head1 SEE ALSO
158
159 SNMP(3pm), NetSNMP::OID(3pm)
160
161 perl(1).
162
163 =cut