vlan.h

来自「模拟vlan的环境,可以创建端口, 删除vlan 等操作,」· C头文件 代码 · 共 100 行

H
100
字号

/* 
 * 
 * vlan.h
 * original author:wengex  2007.8.28
 * 提供vlan.c所使用的函数声明以及全局变量
 * Copyright (c) 2001-2007 by Red-Giant Network, Inc.
 * All rights reserved.
 */
 
#ifndef _VLAN_H

#define _VLAN_H



#define     DEFAULT_VLAN  1
#define    VLAN_NUM    4096
#define    PORT_NUM    1024

#define HASH_SIZE_VLAN        64                    /* vlan表大小 */
#define HASH_SIZE_PORT        64                    /* port表大小 */

#define HASH_MASK_VLAN       (HASH_SIZE_VLAN-1)
#define HASH_MASK_PORT       (HASH_SIZE_PORT-1)





typedef struct vlan_s   vlan_t  ;
typedef struct port_s    port_t;






 struct vlan_t
{
    struct vlan_t  *next;
    int vid;
    char *name;
	struct port_t  *same_vlan_port_table[PORT_NUM];
} ;

struct port_t
{
    struct port_t *next ;
    int pid;
    int speed;
    int duplex;
	struct  vlan_t * same_port_vlan_table[VLAN_NUM] ;
	
};








void  init_vlan(void);;

void print_vlan(int vid );


#endif






























⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?