/* * tcsu.h * * Created on: Apr 17, 2010 * */ #ifndef TCSU_H_ #define TCSU_H_ /* * definicion de caracteres para byte stuffing * */ #define DLE_BSTUFF 'X' #define STX_BSTFUFF 'Y' #define ETX_BSTFUFF 'Z' /* * Estructura del la TPDU */ struct tpdu_header { unsigned char tipo_TPDU; /* indica tipo TPDU valores 0x00 o 0x01*/ unsigned char flags_TPDU; /* Flags para control de TCsU*/ unsigned char nro_sec_TPDU; /* nro de secuencia de TPDU*/ unsigned char nro_ACK_TPDU; /* nro de ACK de TPDU*/ unsigned char ventana_TPDU; /* ventana disponible*/ unsigned char checkSum_TPDU; /* checkeo de TPDU*/ }; #include #include #define MAX_UDP_MSG_SIZE 1024 #define BUFFER_TCSU_SIZE 20480 int crearTCsU(); int aceptarTCsU(unsigned short localUDPport); int conectarTCsU(unsigned short peerUDPport, struct in_addr peerIPaddr); int escribirTCsU(const void *buf, size_t len); int leerTCsU(void *buf, size_t len); int cerrarTCsU(); #endif /* TCSU_H_ */