#ifndef EXTREMITE_H
#define EXTREMITE_H


/* Sets up a tunnel exit on the specified PORT, returns a readable fd
 * representing it. */
int ext_out(int port);

/* Sets up a tunnel entrance connected to the exit at ADDR and PORT,
 * returns a writable fd representing it. */
int ext_in(const char addr[], int port);

/* Establishes a full-duplex tunnel listening on LOCAL_PORT and
 * connected to ADDR and PORT. Copies data from local_r to the tunnel,
 * and data from the tunnel to local_w. */
void ext_bidir(const char addr[], int port, int local_port, int local_r, int local_w);


#endif
