Main Page Class Hierarchy Compound List File List Compound Members Examples

# usipp::TCP Class Reference

`#include <tcp.h>`

Inheritance diagram for usipp::TCP:

List of all members.

## Public Methods
| TCP (const char*)
virtual | ~TCP ()
TCP& | operator= (const TCP&)
| TCP (const TCP&)
u_int16_t | get_srcport ()
u_int16_t | get_dstport ()
u_int32_t | get_seq ()
u_int32_t | get_ack ()
u_int8_t | get_off ()
u_int8_t | get_flags ()
u_int16_t | get_win ()
u_int16_t | get_tcpsum ()
u_int16_t | get_urg ()
int | set_srcport (u_int16_t)
int | set_dstport (u_int16_t)
int | set_seq (u_int32_t)
int | set_ack (u_int32_t)
int | set_off (u_int8_t)
int | set_flags (u_int8_t)
int | set_win (u_int16_t)
int | set_tcpsum (u_int16_t)
int | set_urg (u_int16_t)
tcphdr | get_tcphdr ()
virtual int | sniffpack (void *buf, size_t buflen)
virtual int | sendpack (void *payload, size_t paylen)
virtual int | sendpack (char *pay_string)
virtual int | init_device (char *, int, size_t)
int | set_tcpopt (char kind, unsigned char len, union tcp_options t)
int | reset_tcpopt ()
int | get_tcpopt (char *)

## Detailed Description

All about TCP

## Constructor & Destructor Documentation

usipp::TCP::TCP ( | const char * )

| Expects hostname or IP-adress.

usipp::TCP::~TCP ( | )`[virtual]`

| Destructor

usipp::TCP::TCP ( | const TCP & )

| Copy-constructor

## Member Function Documentation

u_int32_t usipp::TCP::get_ack ( | )

| Get acknowlegde-number of packet.

u_int16_t usipp::TCP::get_dstport ( | )

| Get destination-port in host-order

u_int8_t usipp::TCP::get_flags ( | )

| Get TCP-flags. Can be either of TH_SYN TH_ACK TH_FIN TH_RST TH_PUSH TH_URG or any combination of these (althought common combinations are SYN|ACK or similar)

u_int8_t usipp::TCP::get_off ( | )

| Get TCP-data offset, sometimes called TCP-header-length. Should be 20 in most cases.

u_int32_t usipp::TCP::get_seq ( | )

| Get sequencenumber of packet.

u_int16_t usipp::TCP::get_srcport ( | )

| Get sourceport of packet, in host-order.

tcphdr usipp::TCP::get_tcphdr ( | )

| Return complete TCP header. Usefull for some kinds of ICMP messages

int usipp::TCP::get_tcpopt ( | char * )

| Fill buffer with 20 bytes, return the length of option-field.

int usipp::TCP::init_device ( | char * dev,
| int promisc,
| size_t snaplen )`[virtual]`

| Just sets filter to TCP and calls Datalink::initdevice() Reimplemented from usipp::IP.

TCP & usipp::TCP::operator= ( | const TCP & )

| Assign-operator

int usipp::TCP::reset_tcpopt ( | )

| Clear header from all options

int usipp::TCP::sendpack ( | char * pay_string )`[virtual]`

| Send a string. Reimplemented from usipp::IP.

int usipp::TCP::sendpack ( | void * payload,
| size_t paylen )`[virtual]`

| Send a packet. Reimplemented from usipp::IP.

int usipp::TCP::set_dstport ( | u_int16_t )

| Set destination-port

int usipp::TCP::set_srcport ( | u_int16_t )

| Set source-port

int usipp::TCP::set_tcpopt ( | char kind,
| unsigned char len,
| union tcp_options t )

| Set a TCP-option of kind

int usipp::TCP::set_tcpsum ( | u_int16_t )

| Set TCP-checksum. Doing these will prevent sendpack() from doing this for you. It's not recommented that you do so, coz the sum will almost be weak.

int usipp::TCP::sniffpack ( | void * buf,
| size_t buflen )`[virtual]`

| Capture a packet from the net. Reimplemented from usipp::IP.

The documentation for this class was generated from the following file:

- tcp.h