The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
pkts.c File Reference
#include "includes.h"
#include <zlib.h>
#include "inet.h"
#include "request.h"
#include "endianness.h"
#include "pkts.h"
#include "accept.h"
#include "common.h"
Include dependency graph for pkts.c:

Functions

void pkts_init (interface *ifs, int ifs_n, int queue_init)
 
void pkt_addfrom (PACKET *pkt, inet_prefix *from)
 
void pkt_addto (PACKET *pkt, inet_prefix *to)
 
void pkt_add_dev (PACKET *pkt, interface *dev, int bind_the_socket)
 
void pkt_addsk (PACKET *pkt, int family, int sk, int sk_type)
 
void pkt_addport (PACKET *pkt, u_short port)
 
void pkt_addtimeout (PACKET *pkt, u_int timeout, int recv, int send)
 
void pkt_addcompress (PACKET *pkt)
 
void pkt_addlowdelay (PACKET *pkt)
 
void pkt_addnonblock (PACKET *pkt)
 
void pkt_addhdr (PACKET *pkt, pkt_hdr *hdr)
 
void pkt_addmsg (PACKET *pkt, char *msg)
 
void pkt_clear (PACKET *pkt)
 
void pkt_copy (PACKET *dst, PACKET *src)
 
void pkt_free (PACKET *pkt, int close_socket)
 
int pkt_compress (PACKET *pkt, pkt_hdr *newhdr, char *dst_msg)
 
char * pkt_pack (PACKET *pkt)
 
int pkt_uncompress (PACKET *pkt)
 
int pkt_unpack (PACKET *pkt)
 
int pkt_verify_hdr (PACKET pkt)
 
ssize_t pkt_send (PACKET *pkt)
 
ssize_t pkt_recv_udp (PACKET *pkt)
 
ssize_t pkt_recv_tcp (PACKET *pkt)
 
ssize_t pkt_recv (PACKET *pkt)
 
int pkt_tcp_connect (inet_prefix *host, short port, interface *dev)
 
void pkt_fill_hdr (pkt_hdr *hdr, u_char flags, int id, u_char op, size_t sz)
 
void add_pkt_op (u_char op, char sk_type, u_short port, int(*exec_f)(PACKET pkt))
 
int send_rq (PACKET *pkt, int pkt_flags, u_char rq, int rq_id, u_char re, int check_ack, PACKET *rpkt)
 
int forward_pkt (PACKET rpkt, inet_prefix to)
 
int pkt_err (PACKET pkt, u_char err, int free_pkt)
 
int pkt_exec (PACKET pkt, int acpt_idx)
 
void pkt_queue_init (void)
 
void pkt_queue_close (void)
 
void * wait_and_unlock (void *m)
 
int pkt_q_wait_recv (int id, inet_prefix *from, PACKET *rpkt, pkt_queue **ret_pq)
 
int pkt_q_add_pkt (PACKET pkt)
 
void pkt_q_del (pkt_queue *pq, int close_socket)
 

Variables

int cur_ifs_n
 
pthread_attr_t wait_and_unlock_attr
 

Function Documentation

void add_pkt_op ( u_char  op,
char  sk_type,
u_short  port,
int(*)(PACKET pkt)  exec_f 
)

Here is the caller graph for this function:

int forward_pkt ( PACKET  rpkt,
inet_prefix  to 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void pkt_add_dev ( PACKET pkt,
interface dev,
int  bind_the_socket 
)

Here is the caller graph for this function:

void pkt_addcompress ( PACKET pkt)

Here is the caller graph for this function:

void pkt_addfrom ( PACKET pkt,
inet_prefix from 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void pkt_addhdr ( PACKET pkt,
pkt_hdr *  hdr 
)
void pkt_addlowdelay ( PACKET pkt)

Here is the caller graph for this function:

void pkt_addmsg ( PACKET pkt,
char *  msg 
)
void pkt_addnonblock ( PACKET pkt)

Here is the caller graph for this function:

void pkt_addport ( PACKET pkt,
u_short  port 
)

Here is the caller graph for this function:

void pkt_addsk ( PACKET pkt,
int  family,
int  sk,
int  sk_type 
)

Here is the caller graph for this function:

void pkt_addtimeout ( PACKET pkt,
u_int  timeout,
int  recv,
int  send 
)

Here is the caller graph for this function:

void pkt_addto ( PACKET pkt,
inet_prefix to 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void pkt_clear ( PACKET pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int pkt_compress ( PACKET pkt,
pkt_hdr *  newhdr,
char *  dst_msg 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void pkt_copy ( PACKET dst,
PACKET src 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int pkt_err ( PACKET  pkt,
u_char  err,
int  free_pkt 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int pkt_exec ( PACKET  pkt,
int  acpt_idx 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void pkt_fill_hdr ( pkt_hdr *  hdr,
u_char  flags,
int  id,
u_char  op,
size_t  sz 
)

Here is the caller graph for this function:

void pkt_free ( PACKET pkt,
int  close_socket 
)

Here is the call graph for this function:

Here is the caller graph for this function:

char* pkt_pack ( PACKET pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int pkt_q_add_pkt ( PACKET  pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

void pkt_q_del ( pkt_queue pq,
int  close_socket 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int pkt_q_wait_recv ( int  id,
inet_prefix from,
PACKET rpkt,
pkt_queue **  ret_pq 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void pkt_queue_close ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void pkt_queue_init ( void  )

Here is the caller graph for this function:

ssize_t pkt_recv ( PACKET pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

ssize_t pkt_recv_tcp ( PACKET pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

ssize_t pkt_recv_udp ( PACKET pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

ssize_t pkt_send ( PACKET pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int pkt_tcp_connect ( inet_prefix host,
short  port,
interface dev 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int pkt_uncompress ( PACKET pkt)

Restore the uncompressed packet

Here is the call graph for this function:

Here is the caller graph for this function:

int pkt_unpack ( PACKET pkt)

Here is the call graph for this function:

Here is the caller graph for this function:

int pkt_verify_hdr ( PACKET  pkt)

Here is the caller graph for this function:

void pkts_init ( interface ifs,
int  ifs_n,
int  queue_init 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int send_rq ( PACKET pkt,
int  pkt_flags,
u_char  rq,
int  rq_id,
u_char  re,
int  check_ack,
PACKET rpkt 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void* wait_and_unlock ( void *  m)

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int cur_ifs_n
pthread_attr_t wait_and_unlock_attr