This file is indexed.

/usr/include/dacs/net.h is in libdacs-dev 1.4.38a-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
/*
 * Copyright (c) 2003-2016
 * Distributed Systems Software.  All rights reserved.
 * See the file LICENSE for redistribution information.
 *
 * $Id: net.h 2880 2016-05-16 23:10:16Z brachman $
 */

#ifndef _NET_H_
#define _NET_H_

#include "ds.h"

#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>

typedef enum Net_connection_type {
  NET_TCP        = 0,
  NET_SSL        = 1,
  NET_SSL_VERIFY = 2,
  NET_HTTP       = 3
} Net_connection_type;

#ifndef HAVE_GETNAMEINFO
#define NI_DGRAM       0x01
#define NI_NAMEREQD    0x02
#define NI_NOFQDN      0x04
#define NI_NUMERICHOST 0x08
#define NI_NUMERICSERV 0x10

#define EAI_FAMILY      5
#define EAI_NONAME      8
#define EAI_SYSTEM     11

#ifdef __cplusplus
extern "C" {
#endif

extern int getnameinfo(const struct sockaddr *sa, socklen_t salen,
					   char *host, size_t hostlen, char *serv, size_t servlen,
					   int flags);
#ifdef __cplusplus
}
#endif

#endif

#ifdef __cplusplus
extern "C" {
#endif

extern int net_set_debug_flag(int flag);
extern int net_get_debug_flag(void);
extern int net_tcp_nodelay(int sd);
extern int net_socket_reuseaddr(int sd);
extern int net_set_min_input(int sd, int flag);
extern int net_set_nonblocking(int sd, char **errmsg);
extern int net_set_blocking(int sd, char **errmsg);
extern int net_socket_type(int sd);

extern in_port_t net_get_service_port(char *portname, char *default_portname,
									  char **errmsg);
extern int net_write(int sd, void *buf, size_t buflen);
extern int net_write_str(int sd, char *mesg);
extern int net_write_strln(int sd, char *mesg);

extern int net_tcp_connect(struct sockaddr_in *from, struct sockaddr_in *to,
						   int *read_fd, int *write_fd);
extern int net_connect_to_server_ssl(const char *hostname, in_port_t port,
									 Net_connection_type ct,
									 char *ssl_prog, char *ssl_prog_args,
									 char *ssl_prog_client_crt,
									 char *ssl_prog_ca_crt,
									 int *read_fd, int *write_fd);
extern int net_connect_to_server(const char *hostname, in_port_t port,
								 int *read_fd, int *write_fd);
extern int net_input_or_timeout(int sd, struct timeval *timeout);
extern struct sockaddr_in *net_make_sockaddr(char *hostname, in_port_t port);
extern char *net_addr(struct sockaddr_in *addr, in_port_t *portp);
extern char *net_sockaddr_name(struct sockaddr *sa, socklen_t salen, int flags);
extern char *net_socket_lname(int sd);
extern char *net_socket_rname(int sd);
extern struct sockaddr *net_socket_laddr(int sd);
extern struct sockaddr *net_socket_raddr(int sd);

extern int net_accept_or_timeout(int sd, struct sockaddr *from,
								 struct timeval *timeout);
extern int net_make_server_socket(char *hostname, in_port_t port,
								  int *sdp, struct sockaddr_in **namep);
extern int net_parse_hostname_port(char *str, char **hostname, char **port,
								   in_port_t *portnum);

extern int net_udp_recv(int sd, int max_secs, unsigned char *bufp,
						size_t *buflen, struct sockaddr *from,
						socklen_t *fromlen);
extern int net_udp_send(int sd, struct sockaddr_in *to, unsigned char *datap,
						size_t datalen);

#ifdef __cplusplus
}
#endif

#endif