YAMI4Industry
Functions
network_utils.c File Reference
#include "network_utils.h"
#include "limits.h"
#include "network_constants.h"
#include "utils.h"
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>

Functions

enum yami_result yami_create_listener (const char target[], const struct yami_options *const options, int32_t *const out_socket, enum yami_protocol *const out_protocol, const yami_io_error_function io_error_callback)
 
enum yami_result yami_clean_listener (const int32_t sock, const yami_io_error_function io_error_callback)
 
enum yami_result yami_create_outgoing_connection (const char target[], const struct yami_options *const options, int32_t *const out_socket, enum yami_protocol *const out_protocol, uint32_t *const out_host, uint16_t *const out_port, const yami_io_error_function io_error_callback)
 
enum yami_result yami_accept_tcp (const int32_t listening_sock, const struct yami_options *const options, char out_target[], int32_t *const out_socket, const yami_io_error_function io_error_callback)
 
enum yami_result yami_clean_connection (const int32_t sock, const yami_io_error_function io_error_callback)
 
enum yami_result yami_write_tcp (const int32_t sock, const uint8_t data[], const size_t from, const size_t to, size_t *const out_written, const yami_io_error_function io_error_callback)
 
enum yami_result yami_send_udp (const int32_t sock, const uint32_t host, const uint16_t port, const uint8_t data[], const size_t size, const yami_io_error_function io_error_callback)
 
enum yami_result yami_read_tcp (const int32_t sock, uint8_t out_data[], const size_t from, const size_t to, size_t *const out_readn, const yami_io_error_function io_error_callback)
 
enum yami_result yami_receive_udp (const int32_t sock, char out_target[], const int32_t format_target, uint8_t out_data[], const size_t size, size_t *const out_readn, const yami_io_error_function io_error_callback)
 
enum yami_result yami_wait_for_work (struct yami_channel channels[], size_t channels_array_size, const int32_t listening_sock, int32_t *const out_listening_sock_ready, const size_t timeout, const yami_io_error_function io_error_callback)
 

Function Documentation

enum yami_result yami_accept_tcp ( const int32_t  listening_sock,
const struct yami_options *const  options,
char  out_target[],
int32_t *const  out_socket,
const yami_io_error_function  io_error_callback 
)
enum yami_result yami_clean_connection ( const int32_t  sock,
const yami_io_error_function  io_error_callback 
)
enum yami_result yami_clean_listener ( const int32_t  sock,
const yami_io_error_function  io_error_callback 
)
enum yami_result yami_create_listener ( const char  target[],
const struct yami_options *const  options,
int32_t *const  out_socket,
enum yami_protocol *const  out_protocol,
const yami_io_error_function  io_error_callback 
)
enum yami_result yami_create_outgoing_connection ( const char  target[],
const struct yami_options *const  options,
int32_t *const  out_socket,
enum yami_protocol *const  out_protocol,
uint32_t *const  out_host,
uint16_t *const  out_port,
const yami_io_error_function  io_error_callback 
)
enum yami_result yami_read_tcp ( const int32_t  sock,
uint8_t  out_data[],
const size_t  from,
const size_t  to,
size_t *const  out_readn,
const yami_io_error_function  io_error_callback 
)
enum yami_result yami_receive_udp ( const int32_t  sock,
char  out_target[],
const int32_t  format_target,
uint8_t  out_data[],
const size_t  size,
size_t *const  out_readn,
const yami_io_error_function  io_error_callback 
)
enum yami_result yami_send_udp ( const int32_t  sock,
const uint32_t  host,
const uint16_t  port,
const uint8_t  data[],
const size_t  size,
const yami_io_error_function  io_error_callback 
)
enum yami_result yami_wait_for_work ( struct yami_channel  channels[],
size_t  channels_array_size,
const int32_t  listening_sock,
int32_t *const  out_listening_sock_ready,
const size_t  timeout,
const yami_io_error_function  io_error_callback 
)
enum yami_result yami_write_tcp ( const int32_t  sock,
const uint8_t  data[],
const size_t  from,
const size_t  to,
size_t *const  out_written,
const yami_io_error_function  io_error_callback 
)