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