RTRlib
Loading...
Searching...
No Matches
transport_private.h
Go to the documentation of this file.
1/*
2 * This file is part of RTRlib.
3 *
4 * This file is subject to the terms and conditions of the MIT license.
5 * See the file LICENSE in the top level directory for more details.
6 *
7 * Website: http://rtrlib.realmv6.org/
8 */
9
23#ifndef RTR_TRANSPORT_PRIVATE_H
24#define RTR_TRANSPORT_PRIVATE_H
25
26#include "transport.h"
27
28#include <time.h>
29
36int tr_open(struct tr_socket *socket);
37
42void tr_close(struct tr_socket *socket);
43
49void tr_free(struct tr_socket *socket);
50
61int tr_recv(const struct tr_socket *socket, void *buf, const size_t len, const time_t timeout);
62
72int tr_send(const struct tr_socket *socket, const void *pdu, const size_t len, const time_t timeout);
73
84int tr_send_all(const struct tr_socket *socket, const void *pdu, const size_t len, const time_t timeout);
85
96int tr_recv_all(const struct tr_socket *socket, const void *buf, const size_t len, const time_t timeout);
97
104const char *tr_ident(struct tr_socket *socket);
105
106#endif
void tr_free(struct tr_socket *socket)
Deallocates all memory that the passed socket uses.
int tr_send(const struct tr_socket *socket, const void *pdu, const size_t len, const time_t timeout)
Send <= len Bytes data over the socket.
void tr_close(struct tr_socket *socket)
Close the socket connection.
const char * tr_ident(struct tr_socket *socket)
Returns an identifier for the socket endpoint, eg host:port.
int tr_open(struct tr_socket *socket)
Establish the connection.
int tr_send_all(const struct tr_socket *socket, const void *pdu, const size_t len, const time_t timeout)
Repeatedly calls tr_send(..) till len Bytes were sent, the timeout expired or an error occurred.
int tr_recv_all(const struct tr_socket *socket, const void *buf, const size_t len, const time_t timeout)
Repeatedly calls tr_recv(..) till len Bytes were received, the timeout expired or an error occurred.
int tr_recv(const struct tr_socket *socket, void *buf, const size_t len, const time_t timeout)
Receives <= len Bytes data from the socket.
uint32_t len
Definition rtr_pdus.h:4
A transport socket datastructure.
Definition transport.h:102