input_vlan.h 2.49 KB
Newer Older
Michel Kaempf's avatar
Michel Kaempf committed
1 2 3 4 5 6 7 8
/*******************************************************************************
 * input_vlan.h: vlan input method
 * (c)1999 VideoLAN
 *******************************************************************************
 * ?? 
 *******************************************************************************
 * Required headers:
 * <netinet/in.h>
9
 * "vlc_thread.h"
Michel Kaempf's avatar
Michel Kaempf committed
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
 *******************************************************************************/

/*******************************************************************************
 * Vlan server related constants
 *******************************************************************************/

#define VLAN_SERVER_MSG_LENGTH  256             /* maximum length of a message */
#define VLAN_CLIENT_VERSION     "1.3.0"                 /* vlan client version */

/* Messages codes */
#define VLAN_LOGIN_REQUEST      98        /* login: <version> <login> <passwd> */
#define VLAN_LOGIN_ANSWER       97                    /* login accepted: [msg] */
#define VLAN_LOGIN_REJECTED     96                    /* login rejected: [msg] */

#define VLAN_LOGOUT             99                                   /* logout */

#define VLAN_INFO_REQUEST       31                        /* info: no argument */
#define VLAN_INFO_ANSWER        32/* info ok: <switch> <port> <vlan> <sharers> */
#define VLAN_INFO_REJECTED      33                     /* info rejected: [msg] */

#define VLAN_CHANGE_REQUEST     21/* change: <mac> [ip] <vlan dest> [vlan src] */
#define VLAN_CHANGE_ANSWER      22                         /* change ok: [msg] */
#define VLAN_CHANGE_REJECTED    23                     /* change failed: [msg] */

/*******************************************************************************
 * Macros to build/extract vlan_ids
 *******************************************************************************/
#define VLAN_ID_IFACE( vlan_id )    ( ((vlan_id) >> 8) & 0xff ) 
#define VLAN_ID_VLAN( vlan_id )     ( (vlan_id) & 0xff )
#define VLAN_ID( iface, vlan )      ( ((iface) << 8) | (vlan) )

/*******************************************************************************
 * Prototypes
 *******************************************************************************/
Vincent Seguin's avatar
Vincent Seguin committed
44 45
int     input_VlanCreate  ( void );
void    input_VlanDestroy ( void );
Michel Kaempf's avatar
Michel Kaempf committed
46 47 48 49 50 51 52 53 54

int     input_VlanId            ( char *psz_iface, int i_vlan );
int     input_VlanJoin          ( int i_vlan_id );
void    input_VlanLeave         ( int i_vlan_id );
int     input_VlanRequest       ( char *psz_iface );
int     input_VlanSynchronize   ( void );