Next: , Previous: , Up: Embedding API   [Contents][Index]


5.2.13 Port configurations

A port configuration is a structure defining a network or file system configuration. Depending on the type of a server, it can be bound to one or more port configurations. There are two major types of port configurations: connection oriented (TCP and PIPE), and packet oriented (ICMP, UDP and RAW).

Function: struct sockaddr_in * svz_portcfg_addr (svz_portcfg_t *port)

Return the pointer of the sockaddr_in structure of the given port configuration port if it is a network port configuration. Otherwise return NULL.

Function: in_port_t svz_portcfg_port (svz_portcfg_t *port)

Return the UDP or TCP port of the given port configuration or zero if it neither TCP nor UDP.

Function: char * svz_portcfg_ipaddr (svz_portcfg_t *port)

Return the pointer to the ip address ipaddr of the given port configuration port if it is a network port configuration. Otherwise return NULL.

Function: char * svz_portcfg_device (svz_portcfg_t *port)

Return the network device name stored in the given port configuration port if it is a network port configuration. Return NULL if there is no such device set or if the port configuration is not a network port configuration.

Serveez maintains an internal list of port configurations, with each identified by its name. When you bind a server to a port configuration, it does not get bound to a certain name but to its content. If there are two or more port configuration specifying the same network or file system configuration just a single one gets actually used.

Function: svz_portcfg_t * svz_portcfg_create (void)

Create a new blank port configuration.

Function: int svz_portcfg_equal (svz_portcfg_t *a, svz_portcfg_t *b)

Check if two given port configurations structures are equal, i.e. specifying the same network port or pipe files. Return SVZ_PORTCFG_EQUAL if a and b are identical, SVZ_PORTCFG_MATCH if the network address of either port configuration contains the other (INADDR_ANY match), and otherwise SVZ_PORTCFG_NOMATCH or possibly SVZ_PORTCFG_CONFLICT.

Function: svz_portcfg_t * svz_portcfg_add (char *name, svz_portcfg_t *port)

Add the given port configuration port associated with the name name to the list of known port configurations. Return NULL on errors. If the return port configuration equals the given port configuration the given one has been successfully added.

Function: svz_portcfg_t * svz_portcfg_get (char *name)

Return the port configuration associated with the given name name. Return NULL on errors.

Function: void svz_portcfg_destroy (svz_portcfg_t *port)

Make the given port configuration port completely unusable, removing it from the list of known port configurations. Do nothing if port is NULL.

Function: int svz_portcfg_mkaddr (svz_portcfg_t *this)

Construct the sockaddr_in fields from the ipaddr field. Return zero if it worked. If it does not work, the ipaddr field did not consist of an ip address in dotted decimal form.

Function: svz_portcfg_t * svz_portcfg_dup (svz_portcfg_t *port)

Make a copy of the given port configuration port.


Next: Boot functions, Previous: Server functions, Up: Embedding API   [Contents][Index]