Before doing any lookups, you need to create a server connection.
The current implementation is the Whois lookup.

LU_server_t *
LU_whois_init (const gchar *hostname, int port, int timeout);

Description: 
  Initialise WHOIS server lookup.

Parameters:
  - hostname, name of the server, e.g. "whois.ripe.net"
  - port, port to connect to, e.g. 43
  - timeout in seconds, or 0 for "no timeout"

Return value:
  Address of newly allocated server structure.  Free with LU_cleanup().


These are the generic functions:


LU_ret_t
LU_lookup (LU_server_t *server,
           rpsl_object_t **obj, 
           const gchar *type,
           const gchar *key,
           const ghcar *source);

Description: 
  Lookup an object by key.

Parameters:
  - server, connection to a lookup server
  - obj, used to return the object found (possibly NULL if non-existant)
  - type, object type to find
  - key, the primary key (for routes, use "1.2.3.4/5AS6")
  - source, source database to use

Return values:
  - LU_ERROR
  - LU_OKAY



LU_ret_t
LU_get_object (LU_server_t *server,
               rpsl_object_t **dbase_obj, 
               const rpsl_object_t *obj, 
               const gchar *source);

Description:
  Get the current version of an object from the database.

Parameters:
  - server, connection to a lookup server
  - dbase_obj, used to return the object found (possibly NULL if non-existant)
  - obj, object to find database version of
  - source, source database to use - may be NULL to get from obj

Return values:
  - LU_ERROR
  - LU_OKAY



LU_ret_t 
LU_get_parents (LU_server_t *server, GList **parents,
                const rpsl_object_t *obj, const gchar *source);

Description:
  Get the parents of an object.

Parameters:
  - server, connection to a lookup server
  - parents, used to return a list of parents found (possibly empty), 
    which should be freed with LU_free_parents()
  - obj, object to find parent of
  - source, source database to use - may be NULL to get from obj

Return values:
  - LU_ERROR
  - LU_OKAY

Behaviour:

  These types never have a parent:
    inet-rtr 
    irt
    key-cert
    limerick
    mntner
    person
    role

  Sets may have hierarchical names.  If the name has a colon, ':',
  then the set or aut-num with the name prior to the colon is
  returned, if it exists.  There is only at most one parent.  These
  types are affected:
    as-set
    filter-set
    peering-set
    route-set
    rtr-set

  aut-num or as-block objects may have an as-block as the parent.
  as-blocks do not overlap, so at most one will be returned.

  inetnum and inet6num objects may have parents.  Due to overlapping,
  any number of parents may be returned, all of the same type.

  route objects may have parents.  The parents of a route object
  include one aut-num, any number of route objects, and any number of
  inetnum objects.

  domain objects may have one parent.  The parent is the first object
  in the database that is found after stripping labels off from the
  left.

  


void
LU_free_parents (GList *parents);

Description:
  Frees a list of GList containing rpsl_object_t returned from 
  LU_get_parents().

Parameters:
  - parents, GList containing rpsl_object_t returned from LU_get_parents().

Return values:
  none


void 
LU_cleanup (LU_server_t *server);

Description:
  Frees any resources used by a lookup server connection.

Parameters:
  - server, connection to a lookup server

Return values:
  none
