split afs.h
[paraslash.git] / net.h
1 /*
2 * Copyright (C) 2006 Andre Noll <maan@systemlinux.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
17 */
18
19 /** \file net.h exported symbols from net.c */
20
21 /**
22 * the buffer size of the sun_path component of struct sockaddr_un
23 *
24 * While glibc doesn't define \p UNIX_PATH_MAX, it
25 * documents it has being limited to 108 bytes.
26 */
27 #ifndef UNIX_PATH_MAX
28 #define UNIX_PATH_MAX 108
29 #endif
30
31 struct hostent *get_host_info(char *);
32 int get_socket(void);
33 void init_sockaddr(struct sockaddr_in*, int, const struct hostent*);
34 int para_connect(int, struct sockaddr_in *);
35 int send_buffer(int, const char *);
36 int send_bin_buffer(int, const char *, size_t);
37 int send_va_buffer(int, const char *, ...);
38 int recv_buffer(int, char *, ssize_t);
39 int recv_bin_buffer(int, char *, ssize_t);
40 int para_accept(int, void *addr, socklen_t size);
41 int create_pf_socket(const char *, struct sockaddr_un *, int mod);
42 int init_unix_addr(struct sockaddr_un *, const char *);
43 int recv_cred_buffer(int, char *, size_t);
44 ssize_t send_cred_buffer(int, char*);
45 int recv_pattern(int fd, const char *pattern, size_t bufsize);
46 int init_tcp_socket(int port);
47