#ifndef ETHERLIB_TEST_TCP_CONNBLOCK_H #define ETHERLIB_TEST_TCP_CONNBLOCK_H #define TCP_PORT_FROM_FILTCOND(fc) ((fc)->uw[7]) #define TCP_PORT_TO_FILTCOND(fc,port) (((fc)->uw[7]) = (port)) #include #include "../packet_parsers/ipv4_types.h" #include "../../connection_block.h" struct EthInterface_; /** * Create new TCP connection block * @param intf associated Ethernet interface * @param ipAddr local IP-address * @param port local port * @param cbFn receive callback function * @return TCP connection block */ ConnBlock tcp_new_connblock(struct EthInterface_ *intf, ip4_addr ipAddr, uint16_t port, SieveCallBackFn cbFn); /** * Bind TCP connection to remote socket. * @param connBlock pointer to TCP connection block * @param remoteAddr remote socket address * @param remotePort remote socket port */ void tcp_bind(ConnBlock * connBlock, ip4_addr remoteAddr, uint16_t remotePort); #endif //ETHERLIB_TEST_TCP_CONNBLOCK_H