No longer do we use the ifmgr to walk the addresses attached to this
[mpls-ldp-portable.git] / common / mpls_socket_impl.h
blob5dc806bc9fadefcacd00512ae94d616aa4b38775
2 /*
3 * Copyright (C) James R. Leu 2000
4 * jleu@mindspring.com
6 * This software is covered under the LGPL, for more
7 * info check out http://www.gnu.org/copyleft/lgpl.html
8 */
10 #ifndef _MPLS_SOCKET_IMPL_H_
11 #define _MPLS_SOCKET_IMPL_H_
13 #include "ldp_struct.h"
14 #include "mpls_struct.h"
17 * in: handle
18 * return: mpls_socket_mgr_handle
20 extern mpls_socket_mgr_handle mpls_socket_mgr_open(const mpls_instance_handle
21 handle);
24 * in: handle
26 extern void mpls_socket_mgr_close(const mpls_socket_mgr_handle handle);
29 * in: handle
30 * return: mpls_socket_handle
32 extern mpls_socket_handle mpls_socket_create_tcp(const mpls_socket_mgr_handle
33 handle);
36 * in: handle
37 * return: mpls_socket_handle
39 extern mpls_socket_handle mpls_socket_create_udp(const mpls_socket_mgr_handle
40 handle);
43 * in: handle
44 * return: mpls_socket_handle
46 extern mpls_socket_handle mpls_socket_create_raw(const mpls_socket_mgr_handle
47 handle, int proto);
50 * in: handle,socket,from
51 * out: from
52 * return: mpls_socket_handle
54 extern mpls_socket_handle mpls_socket_tcp_accept(const mpls_socket_mgr_handle
55 handle, const mpls_socket_handle socket, mpls_dest * from);
58 * in: handle,socket
60 extern void mpls_socket_close(const mpls_socket_mgr_handle handle,
61 mpls_socket_handle socket);
64 * in: handle,socket,local
65 * return: mpls_return_enum
67 extern mpls_return_enum mpls_socket_bind(const mpls_socket_mgr_handle handle,
68 mpls_socket_handle socket, const mpls_dest * local);
71 * in: handle, socket, flag
72 * return: mpls_return_enum
74 extern mpls_return_enum mpls_socket_options(const mpls_socket_mgr_handle handle,
75 mpls_socket_handle socket, const uint32_t flag);
78 * in: handle, socket, depth
79 * return: mpls_return_enum
81 extern mpls_return_enum mpls_socket_tcp_listen(const mpls_socket_mgr_handle handle,
82 mpls_socket_handle socket, const int depth);
85 * in: handle, socket, to
86 * return: mpls_return_enum
88 extern mpls_return_enum mpls_socket_tcp_connect(const mpls_socket_mgr_handle
89 handle, mpls_socket_handle socket, const mpls_dest * to);
92 * in: handle, socket
93 * return: int
95 extern int mpls_socket_get_errno(const mpls_socket_mgr_handle handle,
96 mpls_socket_handle socket);
99 * in: handle, socket
100 * return: mpls_return_enum
102 extern mpls_return_enum mpls_socket_connect_status(const mpls_socket_mgr_handle
103 handle, mpls_socket_handle socket);
106 * in: handle, socket, ttl, loop
107 * return: mpls_return_enum
109 extern mpls_return_enum mpls_socket_multicast_options(const mpls_socket_mgr_handle handle, mpls_socket_handle socket, const int ttl, const int loop);
112 * in: handle, socket, iff
113 * return: mpls_return_enum
115 extern mpls_return_enum mpls_socket_multicast_if_tx(const mpls_socket_mgr_handle
116 handle, mpls_socket_handle socket, const ldp_if * iff);
119 * in: handle, socket, iff, mult
120 * return: mpls_return_enum
122 extern mpls_return_enum mpls_socket_multicast_if_join(const mpls_socket_mgr_handle handle, mpls_socket_handle socket, const ldp_if * iff,
123 const mpls_inet_addr * mult);
126 * in: handle, socket, iff, mult
128 extern void mpls_socket_multicast_if_drop(const mpls_socket_mgr_handle handle,
129 mpls_socket_handle socket, const ldp_if * iff, const mpls_inet_addr * mult);
132 * in: handle, socket, object, type
133 * return: mpls_return_enum
135 extern mpls_return_enum mpls_socket_readlist_add(const mpls_socket_mgr_handle
136 handle, mpls_socket_handle socket, void *object, const mpls_socket_enum type);
139 * in: handle, socket
141 extern void mpls_socket_readlist_del(const mpls_socket_mgr_handle handle,
142 mpls_socket_handle socket);
145 * in: handle, socket, object, type
146 * return: mpls_return_enum
148 extern mpls_return_enum mpls_socket_writelist_add(const mpls_socket_mgr_handle
149 handle, mpls_socket_handle socket, void *object, const mpls_socket_enum type);
152 * in: handle, socket
154 extern void mpls_socket_writelist_del(const mpls_socket_mgr_handle handle,
155 mpls_socket_handle socket);
158 * in: handle, o
159 * return: int
161 extern int mpls_socket_tcp_read(const mpls_socket_mgr_handle handle,
162 mpls_socket_handle socket, uint8_t * buffer, const int size);
165 * in: handle, o
166 * return: int
168 extern int mpls_socket_tcp_write(const mpls_socket_mgr_handle handle,
169 mpls_socket_handle socket, uint8_t * buffer, const int size);
172 * in: handle, o
173 * return: int
175 extern int mpls_socket_udp_sendto(const mpls_socket_mgr_handle handle,
176 mpls_socket_handle socket, uint8_t * buffer,
178 const int size, const mpls_dest * to);
181 * in: handle, o
182 * return: int
184 extern int mpls_socket_udp_recvfrom(const mpls_socket_mgr_handle handle,
185 mpls_socket_handle socket, uint8_t * buffer, const int size, mpls_dest * from);
187 #endif