1Info::FDP(3) User Contributed Perl Documentation Info::FDP(3)
2
3
4
6 SNMP::Info::FDP - SNMP Interface to Foundry Discovery Protocol (FDP)
7 using SNMP
8
10 Bruce Rodger, Max Baker
11
13 my $fdp = new SNMP::Info (
14 AutoSpecify => 1,
15 Debug => 1,
16 DestHost => 'router',
17 Community => 'public',
18 Version => 2
19 );
20
21 my $class = $fdp->class();
22 print " Using device sub class : $class\n";
23
24 $hasfdp = $fdp->hasFDP() ? 'yes' : 'no';
25
26 # Print out a map of device ports with FDP neighbors:
27 my $interfaces = $fdp->interfaces();
28 my $fdp_if = $fdp->fdp_if();
29 my $fdp_ip = $fdp->fdp_ip();
30 my $fdp_port = $fdp->fdp_port();
31
32 foreach my $fdp_key (keys %$fdp_ip){
33 my $iid = $fdp_if->{$fdp_key};
34 my $port = $interfaces->{$iid};
35 my $neighbor = $fdp_ip->{$fdp_key};
36 my $neighbor_port = $fdp_port->{$fdp_key};
37 print "Port : $port connected to $neighbor / $neighbor_port\n";
38 }
39
41 SNMP::Info::FDP is a subclass of SNMP::Info that provides an object
42 oriented interface to FDP information through SNMP.
43
44 FDP is a Layer 2 protocol that supplies topology information of devices
45 that also speak FDP, mostly switches and routers. It has similar
46 functionality to Cisco's CDP, and the SNMP interface is virtually
47 identical. FDP is implemented in Foundry devices, including the
48 Bigiron and Fastiron range.
49
50 Create or use a device subclass that inherits this class. Do not use
51 directly.
52
53 Each device implements a subset of the global and cache entries. Check
54 the return value to see if that data is held by the device.
55
56 Inherited Classes
57 None.
58
59 Required MIBs
60 FOUNDRY-SN-SWITCH-GROUP-MIB
61 Needs a reasonably recent MIB. Works OK with B2R07604A.mib, but
62 doesn't work with B2R07600C.
63
65 These are methods that return scalar values from SNMP
66
67 $fdp->hasFDP()
68 Is FDP is active in this device?
69
70 Accounts for SNMP version 1 devices which may have FDP but not
71 fdp_run()
72
73 $fdp->fdp_run()
74 Is FDP enabled on this device?
75
76 ("fdpGlobalRun")
77
78 $fdp->fdp_interval()
79 Interval in seconds at which FDP messages are generated.
80
81 ("fdpGlobalMessageInterval")
82
83 $fdp->fdp_holdtime()
84 Time in seconds that FDP messages are kept.
85
86 ("fdpGlobalHoldTime")
87
88 $fdp->fdp_id()
89 Returns FDP device ID.
90
91 This is the device id broadcast via FDP to other devices, and is
92 what is retrieved from remote devices with $fdp->id().
93
94 ("fdpGlobalDeviceId")
95
96 Overrides
97 CDP compatibility
98
99 $fdp->c_interval()
100 Interval in seconds at which FDP messages are generated.
101
102 ("fdpGlobalMessageInterval")
103
104 $fdp->c_holdtime()
105 Time in seconds that FDP messages are kept.
106
107 ("fdpGlobalHoldTime")
108
109 $fdp->c_id()
110 Returns FDP device ID.
111
112 This is the device id broadcast via FDP to other devices, and is
113 what is retrieved from remote devices with $fdp->id().
114
115 ("fdpGlobalDeviceId")
116
117 $cdp->cdp_run()
118 Is FDP enabled on this device?
119
121 These are methods that return tables of information in the form of a
122 reference to a hash.
123
124 Overrides
125 CDP compatibility
126
127 $fdp->c_capabilities()
128 Returns Device Functional Capabilities. Results are munged into an
129 ascii binary string, 7 digits long, MSB. Each digit represents a
130 bit from the table below.
131
132 From
133 <http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm#18843>:
134
135 (Bit) - Description
136
137 (0x40) - Provides level 1 functionality.
138 (0x20) - The bridge or switch does not forward IGMP Report packets
139 on non router ports.
140 (0x10) - Sends and receives packets for at least one network layer
141 protocol. If the device is routing the protocol, this bit should
142 not be set.
143 (0x08) - Performs level 2 switching. The difference between this
144 bit and bit 0x02 is that a switch does not run the Spanning-Tree
145 Protocol. This device is assumed to be deployed in a physical loop-
146 free topology.
147 (0x04) - Performs level 2 source-route bridging. A source-route
148 bridge would set both this bit and bit 0x02.
149 (0x02) - Performs level 2 transparent bridging.
150 (0x01) - Performs level 3 routing for at least one network layer
151 protocol.
152
153 Thanks to Martin Lorensen "martin -at- lorensen.dk" for a pointer
154 to this information.
155
156 ("fdpCacheCapabilities")
157
158 $fdp->c_domain()
159 The CDP version of this returns remote VTP Management Domain as
160 defined in "CISCO-VTP-MIB::managementDomainName"
161
162 ("fdpCacheVTPMgmtDomain")
163
164 $fdp->c_duplex()
165 Returns the port duplex status from remote devices.
166
167 ("fdpCacheDuplex")
168
169 $fdp->c_id()
170 Returns remote device id string
171
172 ("fdpCacheDeviceId")
173
174 $fdp->c_if()
175 Returns the mapping to the SNMP Interface Table.
176
177 Note that a lot devices don't implement $fdp->fdp_index(), So if
178 it isn't around, we fake it.
179
180 In order to map the fdp table entry back to the interfaces() entry,
181 we truncate the last number off of it :
182
183 # it exists, yay.
184 my $fdp_index = $device->fdp_index();
185 return $fdp_index if defined $fdp_index;
186
187 # if not, let's fake it
188 my $fdp_ip = $device->fdp_ip();
189
190 my %fdp_if
191 foreach my $key (keys %$fdp_ip){
192 $iid = $key;
193 ## Truncate off .1 from fdp response
194 $iid =~ s/\.\d+$//;
195 $fdp_if{$key} = $iid;
196 }
197
198 return \%fdp_if;
199
200 $fdp->c_index()
201 Returns the mapping to the SNMP2 Interface table for FDP Cache
202 Entries.
203
204 Most devices don't implement this, so you probably want to use
205 $fdp->fdp_if() instead.
206
207 See fdp_if() entry.
208
209 ("fdpCacheIfIndex")
210
211 $fdp->c_ip()
212 Returns remote IP address
213
214 ("fdpCacheAddress")
215
216 $fdp->c_platform()
217 Returns remote platform id
218
219 ("fdpCachePlatform")
220
221 $fdp->c_port()
222 Returns remote port ID
223
224 ("fdpDevicePort")
225
226 $fdp->c_proto()
227 Returns remote address type received. Usually IP.
228
229 ("fdpCacheAddressType")
230
231 $fdp->c_ver()
232 Returns remote hardware version
233
234 ("fdpCacheVersion")
235
236 $fdp->c_vlan()
237 Returns the remote interface native VLAN.
238
239 ("fdpCacheNativeVLAN")
240
241
242
243perl v5.12.0 2009-06-12 Info::FDP(3)