X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=network%2Fnetwork.h;h=bfb4ab4baad76436565c27044370fdbd79804a47;hb=a88d4856f5c836896fc18f14d736c42c9d366352;hp=079cea387df6e8cef3cca6113638105deed90702;hpb=24edc387e6e88c32c6142f397ee891746eed62e3;p=my-code%2Fapi.git diff --git a/network/network.h b/network/network.h index 079cea3..bfb4ab4 100644 --- a/network/network.h +++ b/network/network.h @@ -4,6 +4,7 @@ #define NETWORK_H /* includes */ +#define _GNU_SOURCE #include #include #include @@ -52,6 +53,7 @@ typedef struct s_connection { } t_connection; typedef struct s_net { + int outfd; int l_fd; /* fd for tcp conn */ int l_udp_fd; /* fd for udp data receive */ int s_udp_fd; /* fd for udp data send */ @@ -66,7 +68,8 @@ typedef struct s_net { } t_net; /* function prototypes */ -int network_init(t_net *net); +int network_init(t_net *net,int outfd); +int network_listen(t_net *net); int network_shutdown(t_net *net); int network_set_listen_port(t_net *net,in_port_t port); int network_manage_connection(t_net *net);