airutil.h File Reference
Airframe utility functions. More...
#include <airframe/autoinc.h>
Go to the source code of this file.
Defines | |
#define | AIR_TIME_BUF_MINSZ 20 |
Minimum buffer size for air_time_buf_print(). | |
#define | AIR_IPADDR_BUF_MINSZ 16 |
Minimum buffer size for air_ipaddr_buf_print(). | |
#define | AIR_IP6ADDR_BUF_MINSZ 40 |
Minimum buffer size for air_ip6addr_buf_print(). | |
Typedefs | |
typedef enum air_timefmt_en | AirTimeFormat |
Time format description for air_time_* functions. | |
Enumerations | |
enum | air_timefmt_en { AIR_TIME_ISO8601, AIR_TIME_ISO8601_NS, AIR_TIME_SQUISHED, AIR_TIME_ISO8601_HMS } |
Time format description for air_time_* functions. More... | |
Functions | |
void | air_time_g_string_append (GString *str, time_t time, AirTimeFormat fmtid) |
Append a string format of a time to a given GString in a given format. | |
void | air_mstime_g_string_append (GString *str, uint64_t mstime, AirTimeFormat fmtid) |
Append a string format of a time in epoch milliseconds to a given GString in a given format. | |
void | air_time_buf_print (char *buf, time_t time, AirTimeFormat fmtid) |
Write a string format of a time to a given buffer in a given format. | |
time_t | air_time_gm (uint32_t year, uint32_t mon, uint32_t day, uint32_t hour, uint32_t min, uint32_t sec) |
Portable, less unix-ish timegm() implementation. | |
void | air_ipaddr_buf_print (char *buf, uint32_t ipaddr) |
Write the dotted quad format of an IPv4 address to a given buffer. | |
void | air_ip6addr_buf_print (char *buf, uint8_t *ipaddr) |
Write the presentation format of an IPv6 address to a given buffer. | |
uint32_t | air_mask_from_prefix (uint32_t pfx) |
Given a CIDR prefix length, return a mask for extracting the network part of the address. | |
void | air_hexdump_g_string_append (GString *str, char *lpfx, uint8_t *buf, uint32_t len) |
Append a given binary buffer as a hex + ASCII dump with 16 bytes per line to the given GString. | |
gboolean | air_sock_maxrcvbuf (int sock, int *size) |
Maximize socket receive buffer size. | |
gboolean | air_sock_maxsndbuf (int sock, int *size) |
Maximize socket send buffer size. | |
void | air_ignore_sigpipe () |
Ignore SIGPIPE, so that failed pipe writes or TCP writes on reset sockets will return EPIPE instead of terminating the application. |
Detailed Description
Airframe utility functions.A home for utility functions that have no other.
Enumeration Type Documentation
|
Time format description for air_time_* functions.
|
Function Documentation
|
Append a given binary buffer as a hex + ASCII dump with 16 bytes per line to the given GString.
|
|
Write the presentation format of an IPv6 address to a given buffer. The buffer must be at least AIR_IP6ADDR_BUF_MINSZ (40) bytes long.
|
|
Write the dotted quad format of an IPv4 address to a given buffer. The buffer must be at least AIR_IPADDR_BUF_MINSZ (16) bytes long.
|
|
Given a CIDR prefix length, return a mask for extracting the network part of the address.
|
|
Append a string format of a time in epoch milliseconds to a given GString in a given format.
|
|
Maximize socket receive buffer size. Sets the socket's receive buffer to the highest available size less than or equal to the given size.
|
|
Maximize socket send buffer size. Sets the socket's receive buffer to the highest available size less than or equal to the given size.
|
|
Write a string format of a time to a given buffer in a given format.
|
|
Append a string format of a time to a given GString in a given format.
|
|
Portable, less unix-ish timegm() implementation. Converts a UTC year, month, day, hour, minute, and second into a time in epoch seconds. Handles leap years but not leap seconds. mon is 1-based (as in English representations), and year is CE, not 1900-based.
|