L2packets: add getsockname() to net layer

sniff gameclient: add option to bind outcoming socket to some port (TeonPvP hacks)
This commit is contained in:
alexey.min
2012-02-13 04:14:19 +00:00
parent 99d453d594
commit 47d580dae8
3 changed files with 46 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ int L2PNet_Cleanup();
#define L2PFUNC_SELECT 8
#define L2PFUNC_SOCKET 9
#define L2PFUNC_LISTEN 10
#define L2PFUNC_GETSOCKNAME 11
/** Overrides specified function for L2Packets network layer.\n
* New function must have the same prototype as corresponding
* L2PNet_* function!
@@ -192,4 +193,12 @@ int L2PNet_FD_ISSET( unsigned int sock, fd_set *set );
*/
bool L2PNet_resolveHostname( const char *hostname, struct in_addr *pinAddr );
/** Gets local socket address.\n
* \param sock socket
* \param saddr output struct that receives address
* \return 0 on success
*/
int L2PNet_getsockname( unsigned int sock, struct sockaddr_in *saddr );
#endif /* H_L2P_NET_LAYER */