1 #ifndef _OSMOCORE_SOCKET_H
2 #define _OSMOCORE_SOCKET_H
8 /* flags for osmo_sock_init. */
9 #define OSMO_SOCK_F_CONNECT (1 << 0)
10 #define OSMO_SOCK_F_BIND (1 << 1)
11 #define OSMO_SOCK_F_NONBLOCK (1 << 2)
13 int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto,
14 const char *host, uint16_t port, unsigned int flags);
16 int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto,
17 const char *host, uint16_t port, unsigned int flags);
19 int osmo_sock_init_sa(struct sockaddr *ss, uint16_t type,
20 uint8_t proto, unsigned int flags);
22 /* determine if the given address is a local address */
23 int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen);
25 #endif /* _OSMOCORE_SOCKET_H */