Classes | |
struct | ix_adr_t |
struct | ix_netinfo_s |
Defines | |
#define | IX_PROCNAME_LEN 12 |
Typedefs | |
typedef ix_netinfo_s | ix_netinfo_t |
typedef ix_net_s | ix_net_t |
typedef int(*) | IX_SERVER_DISCONNECT_FCT (ix_adr_t *padr, int fd) |
Functions | |
int | ix_adr_init (ix_adr_t *padr, char *hostip, unsigned short hport) |
int | ix_adr_initin (ix_adr_t *padr, void *ip, unsigned short hport) |
int | ix_adr_ip (ix_adr_t *padr, char *ip, int len) |
int | ix_adr_port (ix_adr_t *padr) |
int | ix_adr_getip (ix_adr_t *padr, void *ip) |
int | ix_adr_getnode (ix_adr_t *padr) |
char * | ix_adr_getproc (ix_adr_t *padr) |
char * | ix_adr_getnodeproc (ix_adr_t *padr, char *buf, int buflen) |
int | ix_adr_str (ix_adr_t *padr, char *str, int len) |
char * | ix_adr_str2 (ix_adr_t *padr, char *str, int len) |
int | ix_adr_hostandport (ix_adr_t *padr, char *str, int len) |
void | ix_adr_proc (ix_adr_t *padr, char *proc, int node) |
ix_net_t * | ix_net_new (char *tohost, unsigned short toport) |
void | ix_net_free (ix_net_t *pnet) |
int | ix_net_setto (ix_net_t *pnet, ix_adr_t *toadr) |
int | ix_net_setcb (ix_net_t *pnet, IX_SERVER_DISCONNECT_FCT cb) |
int | ix_net_event (ix_net_t *pnet, unsigned int evid) |
int | ix_net_trigger (ix_net_t *pnet, unsigned int evid) |
int | ix_net_send (ix_net_t *pnet) |
int | ix_tcp_packet (int sd, ix_net_t *pnet) |
int | ix_udp_msg (ix_net_t *pnet, unsigned char *buf, int buflen) |
int | ix_tcp_msg (ix_net_t *pnet, unsigned char *buf, int buflen) |
int | ix_send (ix_net_t *pnet, unsigned char *buf, int buflen, ix_net_t *preply) |
ix_buffer_t * | ix_net_getmsg (ix_net_t *pnet) |
ix_adr_t * | ix_net_getfrom (ix_net_t *pnet) |
ix_adr_t * | ix_net_getto (ix_net_t *pnet) |
ix_netinfo_t * | ix_net_getinfo (ix_net_t *pnet) |
int | ix_net_setinfo (ix_net_t *pnet, ix_netinfo_t *pinfo) |
int | ix_net_tef (ix_net_t *pnet) |
typedef struct ix_net_s ix_net_t |
A Net Packet Object, the implemenation is hidden.
typedef struct ix_netinfo_s ix_netinfo_t |
Additional information of a net packet get/set by ix_net_getinfo() / ix_net_setinfo()
typedef int( * ) IX_SERVER_DISCONNECT_FCT(ix_adr_t *padr, int fd) |
Callback for server disconnect: When server disconnects and callback is set this function is called.
padr | address of server which disconnected file descriptor on which the server was connected. |
int ix_adr_getip | ( | ix_adr_t * | padr, | |
void * | ip | |||
) |
Get binary internet address of ix net address
int ix_adr_getnode | ( | ix_adr_t * | padr | ) |
Get node
padr | pointer to ix net address |
char* ix_adr_getnodeproc | ( | ix_adr_t * | padr, | |
char * | buf, | |||
int | buflen | |||
) |
node number and process name
padr | pointer to ix net address structure | |
buf | buffer to store node number and process name | |
buflen | length of supplied buffer |
char* ix_adr_getproc | ( | ix_adr_t * | padr | ) |
Get process name
padr | pointer to ix net address structure |
int ix_adr_hostandport | ( | ix_adr_t * | padr, | |
char * | str, | |||
int | len | |||
) |
Prints ix_adr_t to string of length len, format ip:port
int ix_adr_init | ( | ix_adr_t * | padr, | |
char * | hostip, | |||
unsigned short | hport | |||
) |
Inits ix_adr_t with ip-adr and port
hostip | ip adress in dot-notation ("127.0.0.1") | |
hport | port number in host-order |
int ix_adr_initin | ( | ix_adr_t * | padr, | |
void * | ip, | |||
unsigned short | hport | |||
) |
Inits ix_adr_t with internet address and port
ip | internet adress in binary network-order | |
hport | port number in host-order |
int ix_adr_ip | ( | ix_adr_t * | padr, | |
char * | ip, | |||
int | len | |||
) |
Prints ip-address of ix_adr_t to string of length len
int ix_adr_port | ( | ix_adr_t * | padr | ) |
Get Port of address
void ix_adr_proc | ( | ix_adr_t * | padr, | |
char * | proc, | |||
int | node | |||
) |
Sets string identifier to processname and node for user friendly additional information
padr | address to be filled | |
proc | processname to be set | |
node | node number to be set |
int ix_adr_str | ( | ix_adr_t * | padr, | |
char * | str, | |||
int | len | |||
) |
Prints ix_adr_t to string of length len format <ip:port:proc>
char* ix_adr_str2 | ( | ix_adr_t * | padr, | |
char * | str, | |||
int | len | |||
) |
Prints ix_adr_t to string of length len format <ip:port:proc>
int ix_net_event | ( | ix_net_t * | pnet, | |
unsigned int | evid | |||
) |
Depreciated
void ix_net_free | ( | ix_net_t * | pnet | ) |
Frees net packet
ix_netinfo_t* ix_net_getinfo | ( | ix_net_t * | pnet | ) |
Get Info from net packet
ix_buffer_t* ix_net_getmsg | ( | ix_net_t * | pnet | ) |
Get message buffer from net packet
ix_net_t* ix_net_new | ( | char * | tohost, | |
unsigned short | toport | |||
) |
Creates a net packet. Parameter tohost may be NULL, use ix_net_setto() to set up destination address.
tohost | destination host | |
toport | destination port |
int ix_net_send | ( | ix_net_t * | pnet | ) |
Sends netpacket, which had to be set up properly
pnet | net packet to send |
int ix_net_setcb | ( | ix_net_t * | pnet, | |
IX_SERVER_DISCONNECT_FCT | cb | |||
) |
Set callback for server disconnect. It is called from dispatcher when the addressed server in this packet disconnects from client.
int ix_net_setinfo | ( | ix_net_t * | pnet, | |
ix_netinfo_t * | pinfo | |||
) |
Sets info to net packet
Sets destination address for packet. This function may be used to reuse a packet.
int ix_net_tef | ( | ix_net_t * | pnet | ) |
Gets the endian toogle flag
int ix_net_trigger | ( | ix_net_t * | pnet, | |
unsigned int | evid | |||
) |
Sends event evid as netpacket, which had to be set up properly
Synchronnous send: This function waits to receive the reply.
pnet | The to-address must have been setup properly with ix_net_new() or ix_net_setto(). The from address is internally taken (port data data supplied by ix_connect_tcp()), see ix_set_reply_cb() for the server setup. | |
buf | send a message buf of len buflen as net-packet per TCP | |
buflen | send a message buf of len buflen as net-packet per TCP | |
preply | the reply of the server, get the message with ix_net_getmessage(). |
int ix_tcp_msg | ( | ix_net_t * | pnet, | |
unsigned char * | buf, | |||
int | buflen | |||
) |
Asynchronous send as net packet per TCP
pnet | The to-address must have been setup properly with ix_net_new() or ix_net_setto(). The from address is internally taken (port data data supplied by ix_connect_tcp()), see ix_set_reply_cb() for the server setup. | |
buf | send a message buf of len buflen as net-packet per TCP | |
buflen | send a message buf of len buflen as net-packet per TCP |
int ix_tcp_packet | ( | int | sd, | |
ix_net_t * | pnet | |||
) |
Sends netpacket, which had to be set up properly
fd | socket descriptor to send netpacket | |
pnet | net packet to send |
int ix_udp_msg | ( | ix_net_t * | pnet, | |
unsigned char * | buf, | |||
int | buflen | |||
) |
Asynchronous send per udp (depreciated)