Libtrap: Internal development docs
1.16.1
|
This file contains common functions and structures used in socket based interfaces (tcp-ip / tls). More...
Go to the source code of this file.
Data Structures | |
struct | buffer_s |
Output buffer structure. More... | |
Macros | |
#define | BUFFER_COUNT_PARAM_LENGTH 13 |
#define | BUFFER_SIZE_PARAM_LENGTH 12 |
#define | MAX_CLIENTS_PARAM_LENGTH 12 |
#define | DEFAULT_MAX_DATA_LENGTH (sizeof(trap_buffer_header_t) + 1024) |
#define | DEFAULT_BUFFER_COUNT 50 |
#define | DEFAULT_BUFFER_SIZE 100000 |
#define | DEFAULT_MAX_CLIENTS 64 |
#define | NO_CLIENTS_SLEEP 100000 |
Typedefs | |
typedef struct buffer_s | buffer_t |
Output buffer structure. More... | |
Functions | |
static void | set_index (uint64_t *bits, int i) |
Set i-th element (one bit) of 'bits' to 1. More... | |
static void | del_index (uint64_t *bits, int i) |
Set i-th element (one bit) of 'bits' to 0. More... | |
static uint64_t | check_index (uint64_t bits, int i) |
Return value of i-th element (one bit) in the 'bits' array. More... | |
static void | insert_into_buffer (buffer_t *buffer, const void *data, uint16_t size) |
Write data into buffer. More... | |
Variables | |
static uint64_t | mask [64] |
Array containing constants used for operations with bit arrays. More... | |
This file contains common functions and structures used in socket based interfaces (tcp-ip / tls).
Definition in file ifc_socket_common.h.
#define BUFFER_COUNT_PARAM_LENGTH 13 |
Used for parsing ifc params
Definition at line 47 of file ifc_socket_common.h.
#define BUFFER_SIZE_PARAM_LENGTH 12 |
Used for parsing ifc params
Definition at line 48 of file ifc_socket_common.h.
#define DEFAULT_BUFFER_COUNT 50 |
Default buffer count
Definition at line 54 of file ifc_socket_common.h.
#define DEFAULT_BUFFER_SIZE 100000 |
Default buffer size [bytes]
Definition at line 58 of file ifc_socket_common.h.
#define DEFAULT_MAX_CLIENTS 64 |
Default size of client array
Definition at line 62 of file ifc_socket_common.h.
#define DEFAULT_MAX_DATA_LENGTH (sizeof(trap_buffer_header_t) + 1024) |
Obsolete?
Definition at line 51 of file ifc_socket_common.h.
#define MAX_CLIENTS_PARAM_LENGTH 12 |
Used for parsing ifc params
Definition at line 49 of file ifc_socket_common.h.
#define NO_CLIENTS_SLEEP 100000 |
Value used in usleep() when waiting for a client to connect
Definition at line 65 of file ifc_socket_common.h.
|
inlinestatic |
Return value of i-th element (one bit) in the 'bits' array.
[in] | bits | Pointer to the bit array. |
[in] | i | Target element's index in the 'bits' array. |
Definition at line 121 of file ifc_socket_common.h.
|
inlinestatic |
Set i-th element (one bit) of 'bits' to 0.
[in] | bits | Pointer to the bit array. |
[in] | i | Target element's index in the 'bits' array. |
Definition at line 108 of file ifc_socket_common.h.
|
inlinestatic |
Write data into buffer.
[in] | buffer | Pointer to the buffer. |
[in] | data | Pointer to data to write. |
[in] | size | Size of the data. |
Definition at line 133 of file ifc_socket_common.h.
|
inlinestatic |
Set i-th element (one bit) of 'bits' to 1.
[in] | bits | Pointer to the bit array. |
[in] | i | Target element's index in the 'bits' array. |
Definition at line 97 of file ifc_socket_common.h.
|
static |
Array containing constants used for operations with bit arrays.
Definition at line 81 of file ifc_socket_common.h.