diff options
author | shennetsind <notind@gmail.com> | 2013-06-08 12:46:37 -0700 |
---|---|---|
committer | shennetsind <notind@gmail.com> | 2013-06-08 12:46:37 -0700 |
commit | 9fdea24a67a39e86c2ae4dd032f08021b35942dc (patch) | |
tree | feea3cd428cee18be3da9bf0bee6d4570d9cad02 /src/common/socket.h | |
parent | b0f866ca419d87fcb3625b45e2437e0a0bb1810e (diff) | |
parent | d73783f22b2bb881aab74524d153d89a5932a199 (diff) | |
download | hercules-9fdea24a67a39e86c2ae4dd032f08021b35942dc.tar.gz hercules-9fdea24a67a39e86c2ae4dd032f08021b35942dc.tar.bz2 hercules-9fdea24a67a39e86c2ae4dd032f08021b35942dc.tar.xz hercules-9fdea24a67a39e86c2ae4dd032f08021b35942dc.zip |
Merge pull request #4 from Earisu/master
Attempt to Merge Earisu's Hercules
Diffstat (limited to 'src/common/socket.h')
-rw-r--r-- | src/common/socket.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/common/socket.h b/src/common/socket.h index 4879cb109..b58cbdccf 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -1,5 +1,6 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena Dev Teams #ifndef _SOCKET_H_ #define _SOCKET_H_ @@ -48,6 +49,9 @@ } \ } while(0) +/* [Ind/Hercules] */ +#define RFIFO2PTR(fd,len) (void*)(session[fd]->rdata + len) + // buffer I/O macros #define RBUFP(p,pos) (((uint8*)(p)) + (pos)) #define RBUFB(p,pos) (*(uint8*)RBUFP((p),(pos))) @@ -94,6 +98,10 @@ struct socket_data void* session_data; // stores application-specific data related to the session }; +struct hSockOpt { + unsigned int silent : 1; + unsigned int setTimeo : 1; +}; // Data prototype declaration @@ -113,7 +121,7 @@ extern bool session_isActive(int fd); // Function prototype declaration int make_listen_bind(uint32 ip, uint16 port); -int make_connection(uint32 ip, uint16 port, bool silent); +int make_connection(uint32 ip, uint16 port, struct hSockOpt *opt); int realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_size); int realloc_writefifo(int fd, size_t addition); int WFIFOSET(int fd, size_t len); |