⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 garp.h

📁 garp code used in switch
💻 H
字号:

// ********************************************
// Name   : garp_.h
// Note   : 
// ********************************************

#ifndef GARP_H__
#define GARP_H__

/******************************************************************************
* GARP : GENERIC ATTRIBUTE REGISTRATION PROTOCOL : COMMON APPLICATION ELEMENTS
*******************************************************************************/

/*
* Each GARP, i.e., each instance of an application that uses the GARP
* protocol, is represented as a struct or control block with common initial
* fields. These comprise pointers to application-specific functions that
* are by the GID and GIP components to signal protocol events to the
* application, and other controls common to all applications. The pointers
* include a pointer to the instances of GID (one per port) for the application,
* and to GIP (one per application). The signaling functions include the
* addition and removal of ports, which the application should use to
* initialize port attributes with any management state required.
*/

// Each GARP struct is an instance of GVRP/GMRP ...etc
// i.e., Each GARP Struct means GARP Application

// GID and GIP components using application-specific functions to signal 
// protocol events to the application.

// GARP Participant = GARP Application + GID
// One GID has many attribute machines


typedef struct /* Garp */
{ 
 Tuint32 process_id;
 void *gid; //pointer to the instances of GID (one per port)
 Tuint32 *gip; //pointer to GIP (one per application)
 Tuint32 max_gid_index;
 Tuint32 last_gid_used;
 void(*join_indication_fn)( void *, void *my_port, Tuint32 joining_gid_index);
 void(*leave_indication_fn)(void *, void *gid,Tuint32 leaving_gid_index);
 void(*join_propagated_fn)( void *, void *gid,Tuint32 joining_gid_index);
 void(*leave_propagated_fn)(void *, void *gid,Tuint32 leaving_gid_index);
 void(*transmit_fn)( void *, void *gid);
 Tuint32 (*receive_fn)( void *, void *gid, void *pdu);
 void (*added_port_fn)( void *, Tuint32 port_no);
 void (*removed_port_fn)( void *, Tuint32 port_no);
} Garp;

#endif /* garp_h__ */

⌨️ 快捷键说明

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