---- How to use hjklib package ---

Hjklib provides some functions that are similar to the standard bsd
socket functions.
Instead of socket you must use a variable of hs type.
When you want to bind a port you must use type hb.

When you use hjklib remember to #include <hjklib.h>
and to compile with -lhjk


---
int init_read_thread(char *iff);

This function open the <iff> interface with pcap libs, start monitoring
connections and add them to the connection database. On error returns -1

---
void printdb();

This function print to stdout a table with the connections database records.
printdb() prints also the index of any record. That index is needed by
hjkconnect() function;

---
hs hjkconnect(int index,u_short TYPE);

This function hijack the connection indicate by index and returns you an hs
(hijack socket). TYPE can be TALK_SERVER or TALK_CLIENT. If TALK_SERVER is
set than the next hjksend() and hjkrecv() will send to and receive from the
server. If TALK_CLIENT is set then you'll send and receive from the client

---
hs hjkconnect_par(u_long saddr,u_short sport,u_long daddr,
                   u_short dport,u_short TYPE);

If you don't want to indicate the connection that you want to hijack with
the index showed by printdb() you can use hjkconnect_par instead of
hjkconnect.. giving it the address and ports of source and dest host of a tcp
connection.

---
hb hjkbind(u_short port,u_long daddr,u_short flags);

If you want to automaticaly hijack any new connection destinated to a
determinated port of a determinate (or also indeterminate) host you have to
use hjkbind. Port is port that you wanna bind (don't htons it!). Daddr is
the destination ip: if you want to hijack connections to any ip you can set
it to HJK_ANY. Flags can be DESYNC_ALL if you want to desync both client and
server or DESYNC_SERV if you want to desync only ther server.
This function returns an hb (hikack bind) that can be used with hjkaccept();

---
hs hjkaccept(hb bnd);

This functions get as argument an hb previously returned by an hjkbind() and 
returns you an hs (hijack socket) that can be used with hjkrecv and hjksend

---
unsigned short hjkrecv(hs rec,char *buf,int len,u_char FLAGS);

This function read data from rec and write them to buf for a maximum of len.
FLAGS is currently not used..
The function returns the number of byte read
---
unsigned short hjksend(hs rec,char *buf,int len,u_char FLAGS);

This functions reads data from buf for a length of len and send them to rec.
FLAGS could be 1 if you want to send the packet for some times instead of
only one.. to be sure that the packet doesn't get lost




