[go: up one dir, main page]

Menu

[6b83fa]: / src / lo_internal.h  Maximize  Restore  History

Download this file

108 lines (93 with data), 3.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
#ifndef LO_INTERNAL_H
#define LO_INTERNAL_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <lo/lo_osc_types.h>
/**
* \brief Validate raw OSC string data. Where applicable, data should be
* in network byte order.
*
* This function is used internally to parse and validate raw OSC data.
*
* Returns length of string or < 0 if data is invalid.
*
* \param data A pointer to the data.
* \param size The size of data in bytes (total bytes remaining).
*/
ssize_t lo_validate_string(void *data, ssize_t size);
/**
* \brief Validate raw OSC blob data. Where applicable, data should be
* in network byte order.
*
* This function is used internally to parse and validate raw OSC data.
*
* Returns length of blob or < 0 if data is invalid.
*
* \param data A pointer to the data.
* \param size The size of data in bytes (total bytes remaining).
*/
ssize_t lo_validate_blob(void *data, ssize_t size);
/**
* \brief Validate raw OSC bundle data. Where applicable, data should be
* in network byte order.
*
* This function is used internally to parse and validate raw OSC data.
*
* Returns length of bundle or < 0 if data is invalid.
*
* \param data A pointer to the data.
* \param size The size of data in bytes (total bytes remaining).
*/
ssize_t lo_validate_bundle(void *data, ssize_t size);
/**
* \brief Validate raw OSC argument data. Where applicable, data should be
* in network byte order.
*
* This function is used internally to parse and validate raw OSC data.
*
* Returns length of argument data or < 0 if data is invalid.
*
* \param type The OSC type of the data item (eg. LO_FLOAT).
* \param data A pointer to the data.
* \param size The size of data in bytes (total bytes remaining).
*/
ssize_t lo_validate_arg(lo_type type, void *data, ssize_t size);
int lo_address_resolve(lo_address a);
/**
* \internal \brief Look up a given interface by name or by IP and
* store the found information in a lo_inaddr. Usually either iface
* or ip will be zero, but not both.
*
* \param t Location to store interface information.
* \param fam Family, either AF_INET or AF_INET6.
* \param iface The interface to look for by name.
* \param ip The IP to find an interface for.
*/
int lo_inaddr_find_iface(lo_inaddr t, int fam,
const char *iface, const char *ip);
/** \internal \brief Add a socket to this server's list of sockets.
* \param s The lo_server
* \param socket The socket number to add.
* \return The index number of the added socket, or -1 on failure.
*/
int lo_server_add_socket(lo_server s, int socket, lo_address a,
struct sockaddr_storage *addr,
socklen_t addr_len);
/** \internal \brief Delete a socket from this server's list of sockets.
* \param s The lo_server
* \param index The index of the socket to delete, -1 if socket is provided.
* \param socket The socket number to delete, -1 if index is provided.
*/
void lo_server_del_socket(lo_server s, int index, int socket);
/** \internal \brief Copy a lo_address into pre-allocated memory. */
void lo_address_copy(lo_address to, lo_address from);
/** \internal \brief Initialize a pre-allocated lo_address from a
* sockaddr. */
void lo_address_init_with_sockaddr(lo_address a,
void *sa, size_t sa_len,
int sock, int prot);
/** \internal \brief Free memory owned by an address, without freeing
* actual lo_address structure. */
void lo_address_free_mem(lo_address a);
#endif