libosmocore  0.6.3
Osmocom core library
socket.h
Go to the documentation of this file.
1 #ifndef _OSMOCORE_SOCKET_H
2 #define _OSMOCORE_SOCKET_H
3 
12 #include <stdint.h>
13 
14 struct sockaddr;
15 struct osmo_fd;
16 
17 /* flags for osmo_sock_init. */
18 #define OSMO_SOCK_F_CONNECT (1 << 0)
19 #define OSMO_SOCK_F_BIND (1 << 1)
20 #define OSMO_SOCK_F_NONBLOCK (1 << 2)
21 
22 int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto,
23  const char *host, uint16_t port, unsigned int flags);
24 
25 int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto,
26  const char *host, uint16_t port, unsigned int flags);
27 
28 int osmo_sock_init_sa(struct sockaddr *ss, uint16_t type,
29  uint8_t proto, unsigned int flags);
30 
31 int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen);
32 
35 #endif /* _OSMOCORE_SOCKET_H */