X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Fivac.git;a=blobdiff_plain;f=src%2Finet.h;h=7f949acee819d4628bdeb28714251dacf13590e0;hp=0f6df5c3e2a014f16bef1710e193859346ea60c6;hb=96a136a4a5ac3321cf3d72328b9fd8167c007a17;hpb=488add8be8351cfca34dd7961de14a2a87953e4a diff --git a/src/inet.h b/src/inet.h index 0f6df5c..7f949ac 100644 --- a/src/inet.h +++ b/src/inet.h @@ -3,13 +3,41 @@ #ifndef INET_H #define INET_H +/* includes */ +#include "ivac.h" +#include +#include +#include +#include +#include + /* net specific includes */ #include +/* defines */ +#define MAX_CONNECTIONS 32 +#define IP_DIGITS 16 +#define C_IN_USE (1<<0) +#define C_INFO_A (1<<1) +#define C_SOCKET (1<<2) +#define C_ESTABL (1<<3) +#define C_HANGUP (1<<4) + /* net specific variables */ +typedef s_connection { + int fd; + char name[CHAR_USERNAME]; + char ip[IP_DIGITS]; + in_port_t port; + unsigned char status; +} t_connection; + typedef s_net { - int l_fd,c_fd; - + int l_fd; /* listen file descriptor */ + in_port_t l_port; + /* limited connections by now -- replaced by list management later */ + int c_count; + t_connection connection[MAX_CONNECTIONS]; } t_net; #endif