RTRlib
transport.h
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_H
24#define RTR_TRANSPORT_H
25#include <time.h>
26
33
36
39
41 TR_INTR = -3,
42
44 TR_CLOSED = -4
45};
46
47struct tr_socket;
48
53typedef void (*tr_close_fp)(void *socket);
54
59typedef int (*tr_open_fp)(void *socket);
60
65typedef void (*tr_free_fp)(struct tr_socket *tr_sock);
66
71typedef int (*tr_recv_fp)(const void *socket, void *pdu, const size_t len, const time_t timeout);
72
77typedef int (*tr_send_fp)(const void *socket, const void *pdu, const size_t len, const time_t timeout);
78
83typedef const char *(*tr_ident_fp)(void *socket);
84
95struct tr_socket {
96 void *socket;
97 tr_open_fp open_fp;
98 tr_close_fp close_fp;
99 tr_free_fp free_fp;
100 tr_send_fp send_fp;
101 tr_recv_fp recv_fp;
102 tr_ident_fp ident_fp;
103};
104
105
106#endif
107/* @} */
const char *(* tr_ident_fp)(void *socket)
A function pointer to a technology specific info function.
Definition: transport.h:83
int(* tr_recv_fp)(const void *socket, void *pdu, const size_t len, const time_t timeout)
A function pointer to a technology specific recv function.
Definition: transport.h:71
void(* tr_free_fp)(struct tr_socket *tr_sock)
A function pointer to a technology specific free function. All memory associated with the tr_socket w...
Definition: transport.h:65
tr_rtvals
The return values for tr_ functions.
Definition: transport.h:30
int(* tr_open_fp)(void *socket)
A function pointer to a technology specific open function.
Definition: transport.h:59
void(* tr_close_fp)(void *socket)
A function pointer to a technology specific close function.
Definition: transport.h:53
int(* tr_send_fp)(const void *socket, const void *pdu, const size_t len, const time_t timeout)
A function pointer to a technology specific send function.
Definition: transport.h:77
@ TR_ERROR
Definition: transport.h:35
@ TR_INTR
Definition: transport.h:41
@ TR_CLOSED
Definition: transport.h:44
@ TR_WOULDBLOCK
Definition: transport.h:38
@ TR_SUCCESS
Operation was successful.
Definition: transport.h:32
A transport socket datastructure.
Definition: transport.h:95