Harald Welte | 33cb71a | 2011-05-21 18:54:32 +0200 | [diff] [blame] | 1 | #ifndef _OSMOCORE_SOCKET_H |
| 2 | #define _OSMOCORE_SOCKET_H |
| 3 | |
| 4 | #include <stdint.h> |
Harald Welte | e476442 | 2011-05-22 12:25:57 +0200 | [diff] [blame] | 5 | |
| 6 | struct sockaddr; |
Harald Welte | 33cb71a | 2011-05-21 18:54:32 +0200 | [diff] [blame] | 7 | |
| 8 | int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, |
| 9 | const char *host, uint16_t port, int connect0_bind1); |
| 10 | |
Harald Welte | 68b1574 | 2011-05-22 21:47:29 +0200 | [diff] [blame] | 11 | int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto, |
| 12 | const char *host, uint16_t port, int connect0_bind1); |
| 13 | |
Harald Welte | 33cb71a | 2011-05-21 18:54:32 +0200 | [diff] [blame] | 14 | int osmo_sock_init_sa(struct sockaddr *ss, uint16_t type, |
| 15 | uint8_t proto, int connect0_bind1); |
| 16 | |
| 17 | /* determine if the given address is a local address */ |
Harald Welte | e476442 | 2011-05-22 12:25:57 +0200 | [diff] [blame] | 18 | int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen); |
Harald Welte | 33cb71a | 2011-05-21 18:54:32 +0200 | [diff] [blame] | 19 | |
| 20 | #endif /* _OSMOCORE_SOCKET_H */ |