Library eigrp
A library supporting parsing and generating a limited subset of the Cisco' EIGRP packets.
Author:
| "Hani Benhabiles" |
Copyright© Same as Nmap--See http://nmap.org/book/man-legal.html Version 0.1 19/07/2012 - First version.
Source: http://nmap.org/svn/nselib/eigrp.lua
Functions
| __tostring (self) |
Converts the request to a string suitable to be sent over a socket. |
| addTLV (self, tlv) |
Adds a TLV table to the table of TLVs. |
| isRoutingTLV (tlvtype) |
Checks if TLV type is one that should contain routing information. |
| new (self, opcode, as, routerid, flags, seq, ack, checksum, tlvs, Checksum, Table) |
Creates a new instance of EIGRP class. |
| parse (eigrp_raw) |
Parses a raw eigrp packet and returns a structred response. |
| setAcknowledge (self, ack) |
Sets the EIGRP Packet acknowledge field. |
| setAS (self, as) |
Sets the EIGRP Packet Autonomous System. |
| setChecksum (self, checksum, integer) |
Sets the EIGRP packet checksum |
| setFlags (self, flags) |
Sets the EIGRP packet flags field. |
| setOpcode (self, opcode) |
Sets the EIGRP Packet opcode |
| setRouterID (self, routerid) |
Sets the EIGRP Packet Virtual Router ID. |
| setSequence (self, seq) |
Sets the EIGRP packet sequence field. |
| setTlvs (self, tlvs) |
Sets the EIGRP Packet tlvs |
| setVersion (self, ver) |
Sets the EIGRP version. |
Functions
- __tostring (self)
-
Converts the request to a string suitable to be sent over a socket.
Parameters
- self:
Return value:
data string containing the complete request to send over the socket - addTLV (self, tlv)
-
Adds a TLV table to the table of TLVs.
Parameters
- self:
- tlv: TLV table.
- isRoutingTLV (tlvtype)
-
Checks if TLV type is one that should contain routing information.
Parameters
- tlvtype: integer TLV type integer to check.
Return value:
status true if tlvtype is a routing information tlv. - new (self, opcode, as, routerid, flags, seq, ack, checksum, tlvs, Checksum, Table)
-
Creates a new instance of EIGRP class.
Parameters
- self:
- opcode: integer Opcode. Defaults to 5 (Hello)
- as: integer Autonomous System. Defaults to 0.
- routerid: integer virtual router ID. defaults to 0.
- flags: integer flags field value. Defaults to 0.
- seq: integer sequence value. Defaults to 0.
- ack: integer acknowledge value. Defaults to 0.
- checksum:
- tlvs:
- Checksum: integer EIGRP packet checksum. Calculated automatically if not manually set.
- Table: TLVs table.
Return value:
o Instance of EIGRP - parse (eigrp_raw)
-
Parses a raw eigrp packet and returns a structred response.
Parameters
- eigrp_raw: string EIGRP Raw packet.
Return value:
response table Structured eigrp packet. - setAcknowledge (self, ack)
-
Sets the EIGRP Packet acknowledge field.
Parameters
- self:
- ack: EIGRP acknowledge.
- setAS (self, as)
-
Sets the EIGRP Packet Autonomous System.
Parameters
- self:
- as: EIGRP A.S.
- setChecksum (self, checksum, integer)
-
Sets the EIGRP packet checksum
Parameters
- self:
- checksum:
- integer: checksum Checksum to set.
- setFlags (self, flags)
-
Sets the EIGRP packet flags field.
Parameters
- self:
- flags: Flags integer value.
- setOpcode (self, opcode)
-
Sets the EIGRP Packet opcode
Parameters
- self:
- opcode: integer EIGRP opcode.
- setRouterID (self, routerid)
-
Sets the EIGRP Packet Virtual Router ID.
Parameters
- self:
- routerid: EIGRP Virtual Router ID.
- setSequence (self, seq)
-
Sets the EIGRP packet sequence field.
Parameters
- self:
- seq: EIGRP sequence.
- setTlvs (self, tlvs)
-
Sets the EIGRP Packet tlvs
Parameters
- self:
- tlvs: table of EIGRP tlvs.
- setVersion (self, ver)
-
Sets the EIGRP version.
Parameters
- self:
- ver: integer version to set.


