Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Socket and Packet Operations.
[Common API]


Data Structures

struct  socket_data
 Socket data. More...

Defines

#define RFIFOP(fd, pos)   (session[fd]->rdata + session[fd]->rdata_pos + (pos))
#define RFIFOB(fd, pos)
#define RFIFOW(fd, pos)
#define RFIFOL(fd, pos)
#define RFIFOSKIP(fd, len)   (session[fd]->rdata_pos += (len))
#define RFIFOREST(fd)   (session[fd]->rdata_size - session[fd]->rdata_pos)
#define RFIFOFLUSH(fd)
#define RFIFOSPACE(fd)   (session[fd]->max_rdata - session[fd]->rdata_size)
#define RBUFP(p, pos)   (((unsigned char*)(p)) + (pos))
#define RBUFB(p, pos)   (*(unsigned char*)((p) + (pos)))
#define RBUFW(p, pos)   (*(unsigned short*)((p) + (pos)))
#define RBUFL(p, pos)   (*(unsigned int*)((p) + (pos)))
#define WFIFOSPACE(fd)   (session[fd]->max_wdata - session[fd]->wdata_size)
#define WPACKETP(pos)   (WPACKETBUF + (pos))
 Gets a pointer from the packet buffer.
#define WPACKETB(pos)   (*(unsigned char*)(WPACKETBUF + (pos)))
 Gets an unsigned char from the packet buffer.
#define WPACKETW(pos)   (*(unsigned short*)(WPACKETBUF + (pos)))
 Gets an unsigned short from packet buffer.
#define WPACKETL(pos)   (*(unsigned int*)(WPACKETBUF + (pos)))
 Gets an unsigned int from packet buffer.
#define WBUFP(p, pos)   (((unsigned char*)(p)) + (pos))
#define WBUFB(p, pos)   (*(unsigned char*)((p) + (pos)))
#define WBUFW(p, pos)   (*(unsigned short*)((p) + (pos)))
#define WBUFL(p, pos)   (*(unsigned int*)((p) + (pos)))

Functions

int make_listen_port (int)
int make_connection (long, int)
int delete_session (int)
int realloc_fifo (int fd, int rfifo_size, int wfifo_size)
void SENDPACKET (const int fd, const int len)
void flush_fifos (void)
int do_sendrecv (int next)
int do_parsepacket (void)
void do_socket (void)
int start_console (int(*parse_console_func)(char *))
void set_defaultparse (int(*defaultparse)(int))
int Net_Init (void)

Variables

char WPACKETBUF [65536]
 The Packet buffer.
socket_datasession [FD_SETSIZE]
int fd_max
char listen_ip [16]
unsigned int addr_ [16]
unsigned int naddr_

Define Documentation

#define RFIFOB fd,
pos   ) 
 

Value:

(*(unsigned char*)      \
         (session[fd]->rdata + session[fd]->rdata_pos + (pos)))

#define RFIFOFLUSH fd   ) 
 

Value:

do {                                                    \
                memmove(session[fd]->rdata,                     \
                        RFIFOP(fd,0), RFIFOREST(fd));           \
                session[fd]->rdata_size = RFIFOREST(fd);        \
                session[fd]->rdata_pos = 0;                     \
        } while (0)

#define RFIFOL fd,
pos   ) 
 

Value:

(*(unsigned int*)       \
         (session[fd]->rdata + session[fd]->rdata_pos + (pos)))

#define RFIFOW fd,
pos   ) 
 

Value:

(*(unsigned short*)     \
         (session[fd]->rdata + session[fd]->rdata_pos + (pos)))

#define WPACKETB pos   )     (*(unsigned char*)(WPACKETBUF + (pos)))
 

Gets an unsigned char from the packet buffer.

Could be used to read or write value. B in the name is for 'byte'. WPACKETB(0) = 20; // will write 20 into the buffer.

Parameters:
pos Buffer index.

#define WPACKETL pos   )     (*(unsigned int*)(WPACKETBUF + (pos)))
 

Gets an unsigned int from packet buffer.

L in the name is for 'long'.

See also:
WPACKETB()

#define WPACKETP pos   )     (WPACKETBUF + (pos))
 

Gets a pointer from the packet buffer.

This operation is similar to &buffer[pos]. P in the name is for 'pointer'.

Parameters:
pos Buffer index.
Returns:
Pointer to location.

#define WPACKETW pos   )     (*(unsigned short*)(WPACKETBUF + (pos)))
 

Gets an unsigned short from packet buffer.

W in the name is for 'word'.

See also:
WPACKETB()


Variable Documentation

char WPACKETBUF[65536]
 

The Packet buffer.

biggest paket: Guild storage with only equipement: 4 + 22 * 1000 = 22004, biggest have size in WPACKETW(2)


Generated on Fri Apr 28 10:20:06 2006 for OpenAthena by  doxygen 1.4.4