Library amqp
The AMQP library provides some basic functionality for retrieving information about an AMQP server's properties.
Summary ------- The library currently supports the AMQP 0-9 and 0-8 protocol specifications.
Overview -------- The library contains the following classes:
o AMQP - This class contains the core functions needed to communicate with AMQP
o AMQPSocket - This is a copy of the VNCSocket class.
Source: http://nmap.org/svn/nselib/amqp.lua
Functions
| close (self) |
Closes an open connection. |
| connect (self, hostid, port, protocol) |
Establishes a connection. |
| connect (self, hostid, port, protocol) |
Establishes a connection. |
| decodeBoolean (self, key, read) |
Decodes a boolean value in the server properties field. |
| decodeString (self, key, read) |
Decodes a string value in the server properties field. |
| decodeTable (self, tbl, tsize) |
Decodes a table value in the server properties field. |
| disconnect (self) |
Disconnects the AMQP socket |
| getProtocolVersion (self) |
Returns the protocol version reported by the server |
| getServerProduct (self) |
Returns the product name reported by the server |
| getServerProperties (self) |
Returns the properties reported by the server |
| getServerVersion (self) |
Returns the product version reported by the server |
| handshake (self) |
Performs the AMQP handshake and determines o The AMQP protocol version o The server properties/capabilities |
| recv (self, count) |
Opposed to the |
| send (self, data) |
Sends data over the socket |
Functions
- close (self)
-
Closes an open connection.
Parameters
- self:
Return values:
- Status (true or false).
- Error code (if status is false).
- connect (self, hostid, port, protocol)
-
Establishes a connection.
Parameters
- self:
- hostid: Hostname or IP address.
- port: Port number.
-
protocol:
"tcp","udp", or
Return values:
- Status (true or false).
- Error code (if status is false).
- connect (self, hostid, port, protocol)
-
Establishes a connection.
Parameters
- self:
- hostid: Hostname or IP address.
- port: Port number.
-
protocol:
"tcp","udp", or
Return values:
- Status (true or false).
- Error code (if status is false).
- decodeBoolean (self, key, read)
-
Decodes a boolean value in the server properties field.
Parameters
- self:
- key: string, the key being read
- read: number, number of bytes already read
Return values:
- status, true on success, false on failure
- error string containing error message if status is false
- decoded value
- number of bytes read after decoding this value
- decodeString (self, key, read)
-
Decodes a string value in the server properties field.
Parameters
- self:
- key: string, the key being read
- read: number, number of bytes already read
Return values:
- status, true on success, false on failure
- error string containing error message if status is false
- decoded value
- number of bytes read after decoding this value
- decodeTable (self, tbl, tsize)
-
Decodes a table value in the server properties field.
Parameters
- self:
- tbl: the decoded table
- tsize: number, the table size in bytes
Return values:
- status, true on success, false on failure
- error string containing error message if status is false
- decoded value
- disconnect (self)
-
Disconnects the AMQP socket
Parameters
- self:
- getProtocolVersion (self)
-
Returns the protocol version reported by the server
Parameters
- self:
Return value:
string containing the version number - getServerProduct (self)
-
Returns the product name reported by the server
Parameters
- self:
Return value:
string containing the product name - getServerProperties (self)
-
Returns the properties reported by the server
Parameters
- self:
Return value:
table containing server properties - getServerVersion (self)
-
Returns the product version reported by the server
Parameters
- self:
Return value:
string containing the version number - handshake (self)
-
Performs the AMQP handshake and determines o The AMQP protocol version o The server properties/capabilities
Parameters
- self:
Return values:
- status, true on success, false on failure
- error string containing error message if status is false
- recv (self, count)
-
Opposed to the
socket:receive_bytesfunction, that returns at least x bytes, this function returns the amount of bytes requested.Parameters
- self:
- count: of bytes to read
Return values:
- true on success, false on failure
- data containing bytes read from the socket err containing error message if status is false
- send (self, data)
-
Sends data over the socket
Parameters
- self:
- data:
Return values:
- Status (true or false).
- Error code (if status is false).


