libexplain  1.4.D001
Functions | Variables
libexplain/buffer/socket_protocol.c File Reference
#include <libexplain/ac/sys/socket.h>
#include <libexplain/ac/netdb.h>
#include <libexplain/ac/netinet/in.h>
#include <libexplain/parse_bits.h>
#include <libexplain/buffer/socket_protocol.h>
#include <libexplain/sizeof.h>
#include <libexplain/string_buffer.h>

Go to the source code of this file.

Functions

void explain_buffer_socket_protocol (explain_string_buffer_t *sb, int protocol)
int explain_parse_socket_protocol_or_die (const char *text, const char *caption)

Variables

static const
explain_parse_bits_table_t 
table []

Function Documentation

void explain_buffer_socket_protocol ( struct explain_string_buffer_t sb,
int  protocol 
)

The explain_buffer_socket_protocol function may be used to print a symbolic value of a socket protocol value to the given string buffer.

Parameters:
sbThe string buffer to print into.
protocolThe socket protocol value to interpret.

Definition at line 111 of file socket_protocol.c.

int explain_parse_socket_protocol_or_die ( const char *  text,
const char *  cptn 
)

The explain_parse_socket_protocol function is used to parse a string into a socket protocol value. On error, prints a diagnostic and exits EXIT_FAILURE.

Parameters:
textThe string to be parsed.
cptnadditional text to add to start of error message
Returns:
the socket value, or -1 on error

Definition at line 135 of file socket_protocol.c.


Variable Documentation

Definition at line 30 of file socket_protocol.c.