Main Page Modules Data Structures File List Data Fields Globals Related Pages

# Exported Structures and Definitions
[Cross-platform socket utilities (IPv4-IPv6)]

## Defines
#define | SOCKET unsigned int
| In Win32, sockets use unsigned integers; in UNIX, they use signed integer.
#define | SOCK_ASSERT(msg, expr) { fprintf(stderr, "%s\n", msg); assert(expr); }
| DEBUG facility: it prints an error message on the screen (stderr).
#define | SOCKBUF_CHECKONLY 1
| 'checkonly' flag, into the rpsock_bufferize()
#define | SOCKBUF_BUFFERIZE 0
| no 'checkonly' flag, into the rpsock_bufferize()
#define | SOCKOPEN_CLIENT 0
| no 'server' flag; it opens a client socket
#define | SOCKOPEN_SERVER 1
| 'server' flag; it opens a server socket
#define | SOCK_RECEIVEALL_NO 0
| Changes the behaviour of the sock_recv(); it does not wait to receive all data.
#define | SOCK_RECEIVEALL_YES 1
| Changes the behaviour of the sock_recv(); it waits to receive all data.

## Define Documentation

#define SOCK_ASSERT | ( | msg,
|  | expr |  | ) | { fprintf(stderr, "%s\n", msg); assert(expr); }

  | DEBUG facility: it prints an error message on the screen (stderr). This macro prints the error on the standard error stream (stderr); if we are working in debug mode (i.e. there is no NDEBUG defined) and we are in Microsoft Visual C++, the error message will appear on the MSVC console as well. When NDEBUG is defined, this macro is empty. Parameters:
  msg: | the message you want to print.
  expr: | 'false' if you want to abort the program, 'true' it you want to print the message and continue.
Returns: No return values. Definition at line 137 of file sockutils.h. Referenced by daemon_checkauth(), daemon_serviceloop(), daemon_thrdatamain(), fileconf_read(), main(), main_active(), main_cleanup(), main_passive(), main_startup(), pcap_read_nocb_remote(), pcap_remoteact_accept(), pcap_setsampling_remote(), pcap_startcapture_remote(), pcap_updatefilter_remote(), rpcap_checkmsg(), rpcap_sendauth(), sock_check_hostlist(), sock_discard(), sock_recv(), and svc_geterr().

#define SOCK_RECEIVEALL_NO 0

| Changes the behaviour of the sock_recv(); it does not wait to receive all data. Definition at line 161 of file sockutils.h.

#define SOCK_RECEIVEALL_YES 1

| Changes the behaviour of the sock_recv(); it waits to receive all data. Definition at line 163 of file sockutils.h.

#define SOCKBUF_BUFFERIZE 0

| no 'checkonly' flag, into the rpsock_bufferize() Definition at line 153 of file sockutils.h.

#define SOCKBUF_CHECKONLY 1

| 'checkonly' flag, into the rpsock_bufferize() Definition at line 151 of file sockutils.h.

#define SOCKET unsigned int

| In Win32, sockets use unsigned integers; in UNIX, they use signed integer. So, we define a generic SOCKET in order to be cross-platform compatible. Definition at line 89 of file sockutils.h. Referenced by daemon_endcapture(), daemon_startcapture(), main_active(), main_passive(), pcap_findalldevs_ex(), pcap_opensource_remote(), pcap_remoteact_accept(), pcap_startcapture_remote(), and sock_open().

#define SOCKOPEN_CLIENT 0

| no 'server' flag; it opens a client socket Definition at line 156 of file sockutils.h.

#define SOCKOPEN_SERVER 1

| 'server' flag; it opens a server socket Definition at line 158 of file sockutils.h.

documentation. Copyright (c) 2002-2003 Politecnico di Torino. All rights reserved.