2008-01-28 21:37:16 +00:00
|
|
|
/* source: xio-socket.h */
|
2016-07-22 06:54:31 +00:00
|
|
|
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */
|
2008-01-27 12:00:08 +00:00
|
|
|
/* Published under the GNU General Public License V.2, see file COPYING */
|
|
|
|
|
|
|
|
#ifndef __xio_socket_h_included
|
|
|
|
#define __xio_socket_h_included 1
|
|
|
|
|
2021-01-01 11:37:02 +00:00
|
|
|
/* SO_PROTOTYPE is defined on Solaris, HP-UX
|
|
|
|
SO_PROTOCOL in Linux, is the better name, but came much later */
|
|
|
|
#ifdef SO_PROTOCOL
|
|
|
|
# undef SO_PROTOTYPE
|
|
|
|
# define SO_PROTOTYPE SO_PROTOCOL
|
|
|
|
#else
|
|
|
|
# ifdef SO_PROTOTYPE
|
|
|
|
# define SO_PROTOCOL SO_PROTOTYPE
|
|
|
|
# else
|
|
|
|
# define SO_PROTOCOL 0x9999
|
|
|
|
# define SO_PROTOTYPE SO_PROTOCOL
|
|
|
|
# endif
|
2008-09-20 21:47:06 +00:00
|
|
|
#endif
|
|
|
|
|
2008-08-17 21:28:11 +00:00
|
|
|
extern const struct addrdesc xioaddr_socket_connect;
|
|
|
|
extern const struct addrdesc xioaddr_socket_listen;
|
|
|
|
extern const struct addrdesc xioaddr_socket_sendto;
|
|
|
|
extern const struct addrdesc xioaddr_socket_datagram;
|
|
|
|
extern const struct addrdesc xioaddr_socket_recvfrom;
|
|
|
|
extern const struct addrdesc xioaddr_socket_recv;
|
|
|
|
|
2008-01-27 12:00:08 +00:00
|
|
|
extern const struct optdesc opt_connect_timeout;
|
|
|
|
extern const struct optdesc opt_so_debug;
|
|
|
|
extern const struct optdesc opt_so_acceptconn;
|
|
|
|
extern const struct optdesc opt_so_broadcast;
|
|
|
|
extern const struct optdesc opt_so_reuseaddr;
|
|
|
|
extern const struct optdesc opt_so_keepalive;
|
|
|
|
extern const struct optdesc opt_so_linger;
|
|
|
|
extern const struct optdesc opt_so_linger;
|
|
|
|
extern const struct optdesc opt_so_oobinline;
|
|
|
|
extern const struct optdesc opt_so_sndbuf;
|
|
|
|
extern const struct optdesc opt_so_sndbuf_late;
|
|
|
|
extern const struct optdesc opt_so_rcvbuf;
|
|
|
|
extern const struct optdesc opt_so_rcvbuf_late;
|
|
|
|
extern const struct optdesc opt_so_error;
|
|
|
|
extern const struct optdesc opt_so_type;
|
|
|
|
extern const struct optdesc opt_so_dontroute;
|
|
|
|
extern const struct optdesc opt_so_rcvlowat;
|
|
|
|
extern const struct optdesc opt_so_sndlowat;
|
2023-10-26 14:48:37 +00:00
|
|
|
extern const struct optdesc opt_so_rcvtimeo;
|
|
|
|
extern const struct optdesc opt_so_sndtimeo;
|
2008-01-27 12:00:08 +00:00
|
|
|
extern const struct optdesc opt_so_audit;
|
|
|
|
extern const struct optdesc opt_so_attach_filter;
|
|
|
|
extern const struct optdesc opt_so_detach_filter;
|
|
|
|
extern const struct optdesc opt_so_bindtodevice;
|
|
|
|
extern const struct optdesc opt_so_bsdcompat;
|
|
|
|
extern const struct optdesc opt_so_cksumrecv;
|
2008-09-22 20:17:55 +00:00
|
|
|
extern const struct optdesc opt_so_timestamp;
|
2008-01-27 12:00:08 +00:00
|
|
|
extern const struct optdesc opt_so_kernaccept;
|
|
|
|
extern const struct optdesc opt_so_no_check;
|
|
|
|
extern const struct optdesc opt_so_noreuseaddr;
|
|
|
|
extern const struct optdesc opt_so_passcred;
|
|
|
|
extern const struct optdesc opt_so_peercred;
|
|
|
|
extern const struct optdesc opt_so_priority;
|
|
|
|
extern const struct optdesc opt_so_reuseport;
|
|
|
|
extern const struct optdesc opt_so_security_authentication;
|
|
|
|
extern const struct optdesc opt_so_security_encryption_network;
|
|
|
|
extern const struct optdesc opt_so_security_encryption_transport;
|
|
|
|
extern const struct optdesc opt_so_use_ifbufs;
|
|
|
|
extern const struct optdesc opt_so_useloopback;
|
|
|
|
extern const struct optdesc opt_so_dgram_errind;
|
|
|
|
extern const struct optdesc opt_so_dontlinger;
|
|
|
|
extern const struct optdesc opt_so_prototype;
|
|
|
|
extern const struct optdesc opt_fiosetown;
|
|
|
|
extern const struct optdesc opt_siocspgrp;
|
|
|
|
extern const struct optdesc opt_bind;
|
|
|
|
extern const struct optdesc opt_protocol_family;
|
2020-12-29 15:45:33 +00:00
|
|
|
extern const struct optdesc opt_setsockopt;
|
2008-05-03 19:44:48 +00:00
|
|
|
extern const struct optdesc opt_setsockopt_int;
|
|
|
|
extern const struct optdesc opt_setsockopt_bin;
|
|
|
|
extern const struct optdesc opt_setsockopt_string;
|
2020-12-29 15:45:33 +00:00
|
|
|
extern const struct optdesc opt_setsockopt_listen;
|
2009-04-02 15:02:29 +00:00
|
|
|
extern const struct optdesc opt_null_eof;
|
2008-01-27 12:00:08 +00:00
|
|
|
|
2008-09-22 20:17:55 +00:00
|
|
|
|
|
|
|
extern
|
|
|
|
char *xiogetifname(int ind, char *val, int ins);
|
|
|
|
|
2008-01-27 12:00:08 +00:00
|
|
|
extern int retropt_socket_pf(struct opt *opts, int *pf);
|
2023-10-26 17:12:38 +00:00
|
|
|
extern int xiogetancillary(int fd, struct msghdr *msgh, int flags);
|
2008-01-27 12:00:08 +00:00
|
|
|
|
|
|
|
extern int xioopen_connect(struct single *fd,
|
2020-12-27 11:39:48 +00:00
|
|
|
union sockaddr_union *us, size_t uslen,
|
2008-01-27 12:00:08 +00:00
|
|
|
struct sockaddr *them, size_t themlen,
|
2008-09-20 21:47:06 +00:00
|
|
|
struct opt *opts,
|
|
|
|
int pf, int socktype, int protocol,
|
2008-01-27 12:00:08 +00:00
|
|
|
bool alt);
|
|
|
|
extern int _xioopen_connect(struct single *fd,
|
2020-12-27 11:39:48 +00:00
|
|
|
union sockaddr_union *us, size_t uslen,
|
2008-01-27 12:00:08 +00:00
|
|
|
struct sockaddr *them, size_t themlen,
|
2008-09-20 21:47:06 +00:00
|
|
|
struct opt *opts,
|
|
|
|
int pf, int socktype, int protocol,
|
2008-01-27 12:00:08 +00:00
|
|
|
bool alt, int level);
|
|
|
|
|
|
|
|
/* common to xioopen_udp_sendto, ..unix_sendto, ..rawip */
|
2023-06-12 21:01:54 +00:00
|
|
|
extern
|
2008-01-27 12:00:08 +00:00
|
|
|
int _xioopen_dgram_sendto(/* them is already in xfd->peersa */
|
|
|
|
union sockaddr_union *us, socklen_t uslen,
|
|
|
|
struct opt *opts,
|
2023-06-14 09:41:44 +00:00
|
|
|
int xioflags, xiosingle_t *xfd, groups_t groups,
|
2022-07-27 07:17:04 +00:00
|
|
|
int pf, int socktype, int ipproto, bool alt);
|
2008-01-27 12:00:08 +00:00
|
|
|
extern
|
|
|
|
int _xioopen_dgram_recvfrom(struct single *xfd, int xioflags,
|
|
|
|
struct sockaddr *us, socklen_t uslen,
|
|
|
|
struct opt *opts,
|
|
|
|
int pf, int socktype, int proto, int level);
|
|
|
|
extern
|
|
|
|
int _xioopen_dgram_recv(struct single *xfd, int xioflags,
|
|
|
|
struct sockaddr *us, socklen_t uslen,
|
|
|
|
struct opt *opts, int pf, int socktype, int proto,
|
|
|
|
int level);
|
2023-09-30 13:18:39 +00:00
|
|
|
extern int xiodopacketinfo(struct single *sfd, struct msghdr *msgh, bool withlog, bool withenv);
|
2023-06-12 21:01:54 +00:00
|
|
|
extern
|
2021-10-28 19:21:07 +00:00
|
|
|
int xiogetpacketsrc(int fd, struct msghdr *msgh, int flags);
|
2008-01-27 12:00:08 +00:00
|
|
|
extern
|
|
|
|
int xiocheckpeer(xiosingle_t *xfd,
|
|
|
|
union sockaddr_union *pa, union sockaddr_union *la);
|
2008-09-22 20:52:03 +00:00
|
|
|
extern
|
|
|
|
int xiosetsockaddrenv(const char *lr, union sockaddr_union *sau, socklen_t salen, int proto);
|
|
|
|
|
2008-08-17 21:28:11 +00:00
|
|
|
extern
|
|
|
|
int xioparsenetwork(const char *rangename, int pf,
|
|
|
|
struct xiorange *range);
|
2023-06-12 21:01:54 +00:00
|
|
|
extern
|
2008-08-17 21:28:11 +00:00
|
|
|
int xioparserange(const char *rangename, int pf, struct xiorange *range);
|
2008-01-27 12:00:08 +00:00
|
|
|
|
2008-09-20 21:47:06 +00:00
|
|
|
extern int
|
|
|
|
xiosocket(struct opt *opts, int pf, int socktype, int proto, int level);
|
2023-06-12 21:01:54 +00:00
|
|
|
extern int
|
2008-09-20 21:47:06 +00:00
|
|
|
xiosocketpair(struct opt *opts, int pf, int socktype, int proto, int sv[2]);
|
2023-10-26 17:45:01 +00:00
|
|
|
extern int xiosock_reuseaddr(int fd, int ipproto, struct opt *opts);
|
2008-01-27 12:00:08 +00:00
|
|
|
|
|
|
|
#endif /* !defined(__xio_socket_h_included) */
|