The Netsukuku Project
0.0.9
An Alternative routing method
|
#include "includes.h"
#include <zlib.h>
#include "inet.h"
#include "request.h"
#include "endianness.h"
#include "pkts.h"
#include "accept.h"
#include "common.h"
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 |
void add_pkt_op | ( | u_char | op, |
char | sk_type, | ||
u_short | port, | ||
int(*)(PACKET pkt) | exec_f | ||
) |
int forward_pkt | ( | PACKET | rpkt, |
inet_prefix | to | ||
) |
void pkt_addcompress | ( | PACKET * | pkt | ) |
void pkt_addfrom | ( | PACKET * | pkt, |
inet_prefix * | from | ||
) |
void pkt_addhdr | ( | PACKET * | pkt, |
pkt_hdr * | hdr | ||
) |
void pkt_addlowdelay | ( | PACKET * | pkt | ) |
void pkt_addmsg | ( | PACKET * | pkt, |
char * | msg | ||
) |
void pkt_addnonblock | ( | PACKET * | pkt | ) |
void pkt_addport | ( | PACKET * | pkt, |
u_short | port | ||
) |
void pkt_addsk | ( | PACKET * | pkt, |
int | family, | ||
int | sk, | ||
int | sk_type | ||
) |
void pkt_addtimeout | ( | PACKET * | pkt, |
u_int | timeout, | ||
int | recv, | ||
int | send | ||
) |
void pkt_addto | ( | PACKET * | pkt, |
inet_prefix * | to | ||
) |
void pkt_clear | ( | PACKET * | pkt | ) |
int pkt_compress | ( | PACKET * | pkt, |
pkt_hdr * | newhdr, | ||
char * | dst_msg | ||
) |
int pkt_err | ( | PACKET | pkt, |
u_char | err, | ||
int | free_pkt | ||
) |
int pkt_exec | ( | PACKET | pkt, |
int | acpt_idx | ||
) |
void pkt_fill_hdr | ( | pkt_hdr * | hdr, |
u_char | flags, | ||
int | id, | ||
u_char | op, | ||
size_t | sz | ||
) |
void pkt_free | ( | PACKET * | pkt, |
int | close_socket | ||
) |
char* pkt_pack | ( | PACKET * | pkt | ) |
int pkt_q_add_pkt | ( | PACKET | pkt | ) |
void pkt_q_del | ( | pkt_queue * | pq, |
int | close_socket | ||
) |
int pkt_q_wait_recv | ( | int | id, |
inet_prefix * | from, | ||
PACKET * | rpkt, | ||
pkt_queue ** | ret_pq | ||
) |
void pkt_queue_close | ( | void | ) |
void pkt_queue_init | ( | void | ) |
ssize_t pkt_recv | ( | PACKET * | pkt | ) |
ssize_t pkt_recv_tcp | ( | PACKET * | pkt | ) |
ssize_t pkt_recv_udp | ( | PACKET * | pkt | ) |
ssize_t pkt_send | ( | PACKET * | pkt | ) |
int pkt_tcp_connect | ( | inet_prefix * | host, |
short | port, | ||
interface * | dev | ||
) |
int pkt_uncompress | ( | PACKET * | pkt | ) |
Restore the uncompressed packet
int pkt_unpack | ( | PACKET * | pkt | ) |
int pkt_verify_hdr | ( | PACKET | pkt | ) |
void pkts_init | ( | interface * | ifs, |
int | ifs_n, | ||
int | queue_init | ||
) |
int send_rq | ( | PACKET * | pkt, |
int | pkt_flags, | ||
u_char | rq, | ||
int | rq_id, | ||
u_char | re, | ||
int | check_ack, | ||
PACKET * | rpkt | ||
) |
void* wait_and_unlock | ( | void * | m | ) |
int cur_ifs_n |
pthread_attr_t wait_and_unlock_attr |