tracedump
single application IP packet sniffer
Defines | Functions

port.h File Reference

#include "tracedump.h"

Go to the source code of this file.

Defines

#define PORT_SET(list, port)   list[port/8] |= 1 << (port%8)
#define PORT_ISSET(list, port)   ((list[port/8] >> (port%8)) & 1)

Functions

void port_init (struct tracedump *td)
 Start the garbage collector thread.
void port_deinit (struct tracedump *td)
 Stop the garbage collector thread.
void port_add (struct sock *ss, bool local)
 Add port by socket.
void * port_list (struct tracedump *td, bool tcp)
 Get list of all local ports from procfs.

Define Documentation

#define PORT_ISSET (   list,
  port 
)    ((list[port/8] >> (port%8)) & 1)

Definition at line 29 of file port.h.

Referenced by gc_thread().

#define PORT_SET (   list,
  port 
)    list[port/8] |= 1 << (port%8)

Definition at line 28 of file port.h.

Referenced by port_list().


Function Documentation

void port_add ( struct sock ss,
bool  local 
)

Add port by socket.

Parameters:
localif true, port in socket is a local port

Definition at line 99 of file port.c.

Referenced by handle_socket().

void port_deinit ( struct tracedump td)

Stop the garbage collector thread.

Definition at line 92 of file port.c.

Referenced by main().

void port_init ( struct tracedump td)

Start the garbage collector thread.

Definition at line 83 of file port.c.

Referenced by main().

void* port_list ( struct tracedump td,
bool  tcp 
)

Get list of all local ports from procfs.

Parameters:
tcpif true, list for TCP; UDP otherwise
Return values:
NULLerror
Note:
allocates memory in td->mm

Definition at line 129 of file port.c.

Referenced by gc_thread().

 All Data Structures Files Functions Variables Enumerations Enumerator Defines