X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fnetutils.h;h=2d47af293efb8288a52ef32e2a0acb0545e6105a;hb=a46b30014c1b8a71af701738c8064d2609377e71;hp=626f859582709ac72e057b9d68c3f0fda23ea59d;hpb=72f3067a6fddcd30e0ee33928a0ec6622ed2e74b;p=vlc diff --git a/include/netutils.h b/include/netutils.h index 626f859582..2d47af293e 100644 --- a/include/netutils.h +++ b/include/netutils.h @@ -1,55 +1,40 @@ -/******************************************************************************* +/***************************************************************************** * netutils.h: various network functions - * (c)1999 VideoLAN - ******************************************************************************* - * This header describe miscellanous utility functions shared between several + * This header describes miscellanous utility functions shared between several * modules. - ******************************************************************************* - * Required headers: - * - *******************************************************************************/ + ***************************************************************************** + * Copyright (C) 1999, 2000, 2001 VideoLAN + * $Id: netutils.h,v 1.22 2002/07/31 20:56:50 sam Exp $ + * + * Authors: Vincent Seguin + * Henri Fallon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ +/* The channel without stream is 0 */ +#define COMMON_CHANNEL 0 -/******************************************************************************* - * if_descr_t: describes a network interface. - ******************************************************************************* - * Note that if the interface is a point to point one, the broadcast address is - * set to the destination address of that interface - *******************************************************************************/ -typedef struct -{ - /* Interface device name (e.g. "eth0") */ - char* psz_ifname; - /* Interface physical address */ - struct sockaddr sa_phys_addr; - /* Interface network address */ - struct sockaddr_in sa_net_addr; - /* Interface broadcast address */ - struct sockaddr_in sa_bcast_addr; - /* Interface flags: see if.h for their description) */ - u16 i_flags; -} if_descr_t; - - -/******************************************************************************* - * net_descr_t: describes all the interfaces of the computer - ******************************************************************************* - * Nothing special to say :) - *******************************************************************************/ -typedef struct -{ - /* Number of networks interfaces described below */ - int i_if_number; - /* Table of if_descr_t describing each interface */ - if_descr_t* a_if; -} net_descr_t; - - -/******************************************************************************* +/***************************************************************************** * Prototypes - *******************************************************************************/ -int ReadIfConf (int i_sockfd, if_descr_t* p_ifdescr, char* psz_name); -int ReadNetConf (int i_sockfd, net_descr_t* p_net_descr); -int BuildInetAddr ( struct sockaddr_in *p_sa_in, char *psz_in_addr, int i_port ); -int ServerPort ( char *psz_addr ); + *****************************************************************************/ +struct sockaddr_in; +int network_BuildAddr ( struct sockaddr_in *, char *, int ); + +#define network_ChannelJoin(a,b) __network_ChannelJoin(VLC_OBJECT(a),b) +#define network_ChannelCreate(a) __network_ChannelCreate(VLC_OBJECT(a)) +VLC_EXPORT( int, __network_ChannelJoin, ( vlc_object_t *, int ) ); +VLC_EXPORT( int, __network_ChannelCreate, ( vlc_object_t * ) );