"Fossies" - the Fresh Open Source Software Archive

Member "socat-1.7.3.2/xio-socket.h" (8 Jan 2017, 4905 Bytes) of package /linux/privat/socat-1.7.3.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "xio-socket.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.7.3.1_vs_1.7.3.2.

    1 /* source: xio-socket.h */
    2 /* Copyright Gerhard Rieger and contributors (see file CHANGES) */
    3 /* Published under the GNU General Public License V.2, see file COPYING */
    4 
    5 #ifndef __xio_socket_h_included
    6 #define __xio_socket_h_included 1
    7 
    8 /* SO_PROTOTYPE is OS defined on Solaris, HP-UX; we lend this for a more
    9    general purpose */ 
   10 #ifndef SO_PROTOTYPE
   11 #define SO_PROTOTYPE 0x9999
   12 #endif
   13 
   14 extern const struct addrdesc xioaddr_socket_connect;
   15 extern const struct addrdesc xioaddr_socket_listen;
   16 extern const struct addrdesc xioaddr_socket_sendto;
   17 extern const struct addrdesc xioaddr_socket_datagram;
   18 extern const struct addrdesc xioaddr_socket_recvfrom;
   19 extern const struct addrdesc xioaddr_socket_recv;
   20 
   21 extern const struct optdesc opt_connect_timeout;
   22 extern const struct optdesc opt_so_debug;
   23 extern const struct optdesc opt_so_acceptconn;
   24 extern const struct optdesc opt_so_broadcast;
   25 extern const struct optdesc opt_so_reuseaddr;
   26 extern const struct optdesc opt_so_keepalive;
   27 extern const struct optdesc opt_so_linger;
   28 extern const struct optdesc opt_so_linger;
   29 extern const struct optdesc opt_so_oobinline;
   30 extern const struct optdesc opt_so_sndbuf;
   31 extern const struct optdesc opt_so_sndbuf_late;
   32 extern const struct optdesc opt_so_rcvbuf;
   33 extern const struct optdesc opt_so_rcvbuf_late;
   34 extern const struct optdesc opt_so_error;
   35 extern const struct optdesc opt_so_type;
   36 extern const struct optdesc opt_so_dontroute;
   37 extern const struct optdesc opt_so_rcvlowat;
   38 extern const struct optdesc opt_so_sndlowat;
   39 extern const struct optdesc opt_so_audit;
   40 extern const struct optdesc opt_so_attach_filter;
   41 extern const struct optdesc opt_so_detach_filter;
   42 extern const struct optdesc opt_so_bindtodevice;
   43 extern const struct optdesc opt_so_bsdcompat;
   44 extern const struct optdesc opt_so_cksumrecv;
   45 extern const struct optdesc opt_so_timestamp;
   46 extern const struct optdesc opt_so_kernaccept;
   47 extern const struct optdesc opt_so_no_check;
   48 extern const struct optdesc opt_so_noreuseaddr;
   49 extern const struct optdesc opt_so_passcred;
   50 extern const struct optdesc opt_so_peercred;
   51 extern const struct optdesc opt_so_priority;
   52 extern const struct optdesc opt_so_reuseport;
   53 extern const struct optdesc opt_so_security_authentication;
   54 extern const struct optdesc opt_so_security_encryption_network;
   55 extern const struct optdesc opt_so_security_encryption_transport;
   56 extern const struct optdesc opt_so_use_ifbufs;
   57 extern const struct optdesc opt_so_useloopback;
   58 extern const struct optdesc opt_so_dgram_errind;
   59 extern const struct optdesc opt_so_dontlinger;
   60 extern const struct optdesc opt_so_prototype;
   61 extern const struct optdesc opt_fiosetown;
   62 extern const struct optdesc opt_siocspgrp;
   63 extern const struct optdesc opt_bind;
   64 extern const struct optdesc opt_protocol_family;
   65 extern const struct optdesc opt_setsockopt_int;
   66 extern const struct optdesc opt_setsockopt_bin;
   67 extern const struct optdesc opt_setsockopt_string;
   68 extern const struct optdesc opt_null_eof;
   69 
   70 
   71 extern
   72 char *xiogetifname(int ind, char *val, int ins);
   73 
   74 extern int retropt_socket_pf(struct opt *opts, int *pf);
   75 
   76 extern int xioopen_connect(struct single *fd,
   77                 struct sockaddr *us, size_t uslen,
   78                 struct sockaddr *them, size_t themlen,
   79                 struct opt *opts,
   80                int pf, int socktype, int protocol,
   81                 bool alt);
   82 extern int _xioopen_connect(struct single *fd,
   83                 struct sockaddr *us, size_t uslen,
   84                 struct sockaddr *them, size_t themlen,
   85                 struct opt *opts,
   86                 int pf, int socktype, int protocol,
   87                 bool alt, int level);
   88 
   89 /* common to xioopen_udp_sendto, ..unix_sendto, ..rawip */
   90 extern 
   91 int _xioopen_dgram_sendto(/* them is already in xfd->peersa */
   92             union sockaddr_union *us, socklen_t uslen,
   93             struct opt *opts,
   94             int xioflags, xiosingle_t *xfd, unsigned groups,
   95             int pf, int socktype, int ipproto);
   96 extern
   97 int _xioopen_dgram_recvfrom(struct single *xfd, int xioflags,
   98                 struct sockaddr *us, socklen_t uslen,
   99                 struct opt *opts,
  100                 int pf, int socktype, int proto, int level);
  101 extern
  102 int _xioopen_dgram_recv(struct single *xfd, int xioflags,
  103             struct sockaddr *us, socklen_t uslen,
  104             struct opt *opts, int pf, int socktype, int proto,
  105             int level);
  106 extern
  107 int xiodopacketinfo(struct msghdr *msgh, bool withlog, bool withenv);
  108 extern 
  109 int xiogetpacketsrc(int fd, struct msghdr *msgh);
  110 extern
  111 int xiocheckpeer(xiosingle_t *xfd,
  112          union sockaddr_union *pa, union sockaddr_union *la);
  113 extern
  114 int xiosetsockaddrenv(const char *lr, union sockaddr_union *sau, socklen_t salen, int proto);
  115 
  116 extern
  117 int xioparsenetwork(const char *rangename, int pf,
  118             struct xiorange *range);
  119 extern 
  120 int xioparserange(const char *rangename, int pf, struct xiorange *range);
  121 
  122 extern int
  123 xiosocket(struct opt *opts, int pf, int socktype, int proto, int level);
  124 extern int 
  125 xiosocketpair(struct opt *opts, int pf, int socktype, int proto, int sv[2]);
  126 
  127 #endif /* !defined(__xio_socket_h_included) */