libosmocore  0.9.6.315-40e62
Osmocom core library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
socket.h
Go to the documentation of this file.
1 
4 #pragma once
5 
10 #include <stdint.h>
11 
12 struct sockaddr;
13 struct osmo_fd;
14 
15 /* flags for osmo_sock_init. */
17 #define OSMO_SOCK_F_CONNECT (1 << 0)
18 
19 #define OSMO_SOCK_F_BIND (1 << 1)
20 
21 #define OSMO_SOCK_F_NONBLOCK (1 << 2)
22 
23 int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto,
24  const char *host, uint16_t port, unsigned int flags);
25 
26 int osmo_sock_init2(uint16_t family, uint16_t type, uint8_t proto,
27  const char *local_host, uint16_t local_port,
28  const char *remote_host, uint16_t remote_port, unsigned int flags);
29 
30 int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto,
31  const char *host, uint16_t port, unsigned int flags);
32 
33 int osmo_sock_init2_ofd(struct osmo_fd *ofd, int family, int type, int proto,
34  const char *local_host, uint16_t local_port,
35  const char *remote_host, uint16_t remote_port, unsigned int flags);
36 
37 int osmo_sock_init_sa(struct sockaddr *ss, uint16_t type,
38  uint8_t proto, unsigned int flags);
39 
40 int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen);
41 
42 int osmo_sock_unix_init(uint16_t type, uint8_t proto,
43  const char *socket_path, unsigned int flags);
44 
45 int osmo_sock_unix_init_ofd(struct osmo_fd *ofd, uint16_t type, uint8_t proto,
46  const char *socket_path, unsigned int flags);
47 
48 char *osmo_sock_get_name(void *ctx, int fd);
49 
char * osmo_sock_get_name(void *ctx, int fd)
int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto, const char *host, uint16_t port, unsigned int flags)
int osmo_sock_init2_ofd(struct osmo_fd *ofd, int family, int type, int proto, const char *local_host, uint16_t local_port, const char *remote_host, uint16_t remote_port, unsigned int flags)
int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, const char *host, uint16_t port, unsigned int flags)
int osmo_sock_init_sa(struct sockaddr *ss, uint16_t type, uint8_t proto, unsigned int flags)
int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen)
int osmo_sock_init2(uint16_t family, uint16_t type, uint8_t proto, const char *local_host, uint16_t local_port, const char *remote_host, uint16_t remote_port, unsigned int flags)
uint8_t type
see GSMTAP_TYPE_*
Definition: gsmtap.h:113
int osmo_sock_unix_init(uint16_t type, uint8_t proto, const char *socket_path, unsigned int flags)
Structure representing a file dsecriptor.
Definition: select.h:22
int osmo_sock_unix_init_ofd(struct osmo_fd *ofd, uint16_t type, uint8_t proto, const char *socket_path, unsigned int flags)
int fd
actual operating-system level file decriptor
Definition: select.h:26