Library giop
GIOP Library supporting a very limited subset of operations
Summary ------- The library currently provides functionality to connect and query the CORBA naming service for a list of available objects.
Overview -------- The library contains the following classes:
o Packet.* - The Packet classes contain specific packets and function to serialize them to strings that can be sent over the wire. Each class may also contain a function to parse the servers response.
o Comm - Implements a number of functions to handle communication over the the Socket class.
o Helper - A helper class that provides easy access to the rest of the library
o Socket - This is a copy of the DB2Socket class which provides fundamental buffering
Example ------- The following sample code illustrates how scripts can use the Helper class to interface the library:
helper = giop.Helper:new(host, port) status, err = helper:Connect() status, ctx = helper:GetNamingContext() status, objs = helper:ListObjects(ctx)
Additional information ---------------------- The implementation is based on packet dumps and the decoding Wireshark provides.
This implementation is tested and known to work against: x Sun's JAVA orbd
Author:
| "Patrik Karlsson <patrik@cqure.net>" |
Copyright© Same as Nmap--See http://nmap.org/book/man-legal.html
Source: http://nmap.org/svn/nselib/giop.lua
Functions
| ["_is_a"] (packet) |
Decodes a _is_a response (not implemented) |
| ["get"] (packet) |
Decodes a get response |
| ["list"] (packet) |
Decodes a list response |
| __tostring (self) |
Converts the class to a string suitable to send over the socket |
| __tostring (self) |
Converts the class to a string suitable to send over the socket |
| __tostring (self) |
Converts the class to a string suitable to send over the socket |
| __tostring (self) |
Converts the class to a string suitable to send over the socket |
| __tostring (self) |
Converts the class to a string suitable to send over the socket |
| __tostring (self) |
Converts the class to a string suitable to send over the socket |
| addServiceContext (self, id, data, pad) |
Creates and adds a service context to the packet |
| addServiceContext (self, id, data, pad) |
Creates and adds a service context to the packet |
| addServiceContext (self, id, data, pad) |
Creates and adds a service context to the packet |
| close (self) |
Closes an open connection. |
| connect (self, hostid, port, protocol) |
Establishes a connection. |
| Connect (self) |
Connects and performs protocol negotiation with the Oracle server |
| exchGIOPPacket (self, packet) |
Sends and recieves a GIOP packet |
| new (self, socket) |
Creates a new Comm instance |
| new (self, socket) |
Creates a new Comm instance |
| new (self, socket) |
Creates a new Comm instance |
| new (self, socket) |
Creates a new Comm instance |
| new (self, socket) |
Creates a new Comm instance |
| new (self, socket) |
Creates a new Comm instance |
| new (self, socket) |
Creates a new Comm instance |
| new (self, socket) |
Creates a new Comm instance |
| recv (self, count) |
Opposed to the |
| recv (self, count) |
Opposed to the |
| recv (self, count) |
Opposed to the |
| send (self, data) |
Sends data over the socket |
| setVersion (self, version) |
Sets the packet version |
Functions
- ["_is_a"] (packet)
-
Decodes a _is_a response (not implemented)
Parameters
-
packet:
the GIOP packet as recieved by the comm
exchGIOPPacketfunction
Return value:
status, always true -
packet:
the GIOP packet as recieved by the comm
- ["get"] (packet)
-
Decodes a get response
Parameters
-
packet:
the GIOP packet as recieved by the comm
exchGIOPPacketfunction
Return values:
- status true on success, false on failure
- table containing
ipandctx
-
packet:
the GIOP packet as recieved by the comm
- ["list"] (packet)
-
Decodes a list response
Parameters
-
packet:
the GIOP packet as recieved by the comm
exchGIOPPacketfunction
Return values:
- status true on success, false on failure
- table containing
id,kindandenumor error message if status is false
-
packet:
the GIOP packet as recieved by the comm
- __tostring (self)
-
Converts the class to a string suitable to send over the socket
Parameters
- self:
Return value:
string containing the packet data - __tostring (self)
-
Converts the class to a string suitable to send over the socket
Parameters
- self:
Return value:
string containing the packet data - __tostring (self)
-
Converts the class to a string suitable to send over the socket
Parameters
- self:
Return value:
string containing the packet data - __tostring (self)
-
Converts the class to a string suitable to send over the socket
Parameters
- self:
Return value:
string containing the packet data - __tostring (self)
-
Converts the class to a string suitable to send over the socket
Parameters
- self:
Return value:
string containing the packet data - __tostring (self)
-
Converts the class to a string suitable to send over the socket
Parameters
- self:
Return value:
string containing the packet data - addServiceContext (self, id, data, pad)
-
Creates and adds a service context to the packet
Parameters
- self:
- id: number containing the context id
- data: the service context data
- pad: [optional] number used to pad after the service context
- addServiceContext (self, id, data, pad)
-
Creates and adds a service context to the packet
Parameters
- self:
- id: number containing the context id
- data: the service context data
- pad: [optional] number used to pad after the service context
- addServiceContext (self, id, data, pad)
-
Creates and adds a service context to the packet
Parameters
- self:
- id: number containing the context id
- data: the service context data
- pad: [optional] number used to pad after the service context
- 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)
-
Connects and performs protocol negotiation with the Oracle server
Parameters
- self:
Return values:
- true on success, false on failure
- err containing error message when status is false
- exchGIOPPacket (self, packet)
-
Sends and recieves a GIOP packet
Parameters
- self:
- packet: containing a Packet.* object, the object must implement the __tostring meta method
Return values:
- status true on success, false on failure
- data decoder specific data, see the corresponding MessageDecoder for more information.
- new (self, socket)
-
Creates a new Comm instance
Parameters
- self:
- socket: containing a buffered socket connected to the server
Return value:
a new Comm instance - new (self, socket)
-
Creates a new Comm instance
Parameters
- self:
- socket: containing a buffered socket connected to the server
Return value:
a new Comm instance - new (self, socket)
-
Creates a new Comm instance
Parameters
- self:
- socket: containing a buffered socket connected to the server
Return value:
a new Comm instance - new (self, socket)
-
Creates a new Comm instance
Parameters
- self:
- socket: containing a buffered socket connected to the server
Return value:
a new Comm instance - new (self, socket)
-
Creates a new Comm instance
Parameters
- self:
- socket: containing a buffered socket connected to the server
Return value:
a new Comm instance - new (self, socket)
-
Creates a new Comm instance
Parameters
- self:
- socket: containing a buffered socket connected to the server
Return value:
a new Comm instance - new (self, socket)
-
Creates a new Comm instance
Parameters
- self:
- socket: containing a buffered socket connected to the server
Return value:
a new Comm instance - new (self, socket)
-
Creates a new Comm instance
Parameters
- self:
- socket: containing a buffered socket connected to the server
Return value:
a new Comm instance - 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
- 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
- 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).
- setVersion (self, version)
-
Sets the packet version
Parameters
- self:
- version: number containing the version to use


