1 /*****************************************************************************
2 * netutils.h: various network functions
3 * This header describes miscellanous utility functions shared between several
5 *****************************************************************************
6 * Copyright (C) 1999, 2000 VideoLAN
8 * Authors: Vincent Seguin <seguin@via.ecp.fr>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 /*****************************************************************************
29 *****************************************************************************/
32 /*****************************************************************************
33 * if_descr_t: describes a network interface.
34 *****************************************************************************
35 * Note that if the interface is a point to point one, the broadcast address is
36 * set to the destination address of that interface
37 *****************************************************************************/
40 /* Interface device name (e.g. "eth0") */
42 /* Interface physical address */
43 struct sockaddr sa_phys_addr;
44 /* Interface network address */
45 struct sockaddr_in sa_net_addr;
46 /* Interface broadcast address */
47 struct sockaddr_in sa_bcast_addr;
48 /* Interface flags: see if.h for their description) */
53 /*****************************************************************************
54 * net_descr_t: describes all the interfaces of the computer
55 *****************************************************************************
56 * Nothing special to say :)
57 *****************************************************************************/
60 /* Number of networks interfaces described below */
62 /* Table of if_descr_t describing each interface */
67 /*****************************************************************************
69 *****************************************************************************/
70 int ReadIfConf (int i_sockfd, if_descr_t* p_ifdescr, char* psz_name);
71 int ReadNetConf (int i_sockfd, net_descr_t* p_net_descr);
72 int BuildInetAddr ( struct sockaddr_in *p_sa_in, char *psz_in_addr, int i_port );
73 int ServerPort ( char *psz_addr );