00001
00002
00003
00004
00005
00006
00007
00008
00009
00023 #ifndef RTR_TRANSPORT_H
00024 #define RTR_TRANSPORT_H
00025 #include <time.h>
00026
00030 enum tr_rtvals {
00032 TR_SUCCESS = 0,
00033
00035 TR_ERROR = -1,
00036
00038 TR_WOULDBLOCK = -2,
00039
00041 TR_INTR = -3,
00042
00044 TR_CLOSED = -4
00045 };
00046
00047 struct tr_socket;
00048
00053 typedef void (*tr_close_fp)(void *socket);
00054
00059 typedef int (*tr_open_fp)(void *socket);
00060
00065 typedef void (*tr_free_fp)(struct tr_socket *tr_sock);
00066
00071 typedef int (*tr_recv_fp)(const void *socket, void *pdu, const size_t len, const time_t timeout);
00072
00077 typedef int (*tr_send_fp)(const void *socket, const void *pdu, const size_t len, const time_t timeout);
00078
00083 typedef const char *(*tr_ident_fp)(void *socket);
00084
00095 struct tr_socket {
00096 void *socket;
00097 tr_open_fp open_fp;
00098 tr_close_fp close_fp;
00099 tr_free_fp free_fp;
00100 tr_send_fp send_fp;
00101 tr_recv_fp recv_fp;
00102 tr_ident_fp ident_fp;
00103 };
00104
00105
00106 #endif
00107