versadac  1
versadac - Scalable Recorder Firmware
lldprx.h
1 /*---------------------------------------------------------------------------*/
2 /* Copyright (C) 2006 Woodhead Software & Electonics. All rights reserved. */
3 /*---------------------------------------------------------------------------*/
4 /* This program is protected by international copyright. */
5 /* */
6 /* The use of this software including but not limited to its Source Code */
7 /* is subject to restrictions as agreed in the license agreement between */
8 /* you and Woodhead. */
9 /* Copying or distribution is not allowed unless expressly permitted */
10 /* according to your license agreement with Woodhead. */
11 /*---------------------------------------------------------------------------*/
12 /* */
13 /* Project : STACK PROFINET Controller */
14 /* Component : LLDP */
15 /* $Workfile:: lldprx.h $*/
16 /* $Revision:: 1 $*/
17 /* $Date:: 9/07/09 4:45p $*/
18 /* */
19 /*---------------------------------------------------------------------------*/
20 /* */
21 /* D e s c r i p t i o n : */
22 /* - LLDP Receiver header */
23 /*---------------------------------------------------------------------------*/
24 #ifndef _LLDPRX_H
25 #define _LLDPRX_H
26 
27 #ifdef LLDP_RECEIVER
28 
29 /* Rx state machine */
30 #define ST_RX_LLDP_WAIT_PORT_OPERATIONNAL 0
31 #define ST_RX_LLDP_INITIALIZE 1
32 #define ST_RX_LLDP_DELETE_AGED_INFO 2
33 #define ST_RX_LLDP_RX_WAIT_FOR_FRAME 3
34 #define ST_RX_LLDP_RX_FRAME 4
35 #define ST_RX_LLDP_DELETE_INFO 5
36 #define ST_RX_LLDP_UPDATE_INFO 6
37 
38 
39 /* LLDP Rx Stat */
40 typedef struct _LLDP_RX_STATS {
41 
42  APP_DWORD dwStatsAgeOutsTotal; /* 802.1AB 10.5.2.2*/
43  APP_DWORD dwStatsFramesDiscardedTotal; /* 802.1AB 10.5.2.2*/
44  APP_DWORD dwStatsFramesInErrorsTotal; /* 802.1AB 10.5.2.2*/
45  APP_DWORD dwStatsFramesInTotal; /* 802.1AB 10.5.2.2*/
46  APP_DWORD dwStatsTLVsDiscardedTotal; /* 802.1AB 10.5.2.2*/
47  APP_DWORD dwStatsTLVsUnrecognizedTotal; /* 802.1AB 10.5.2.2*/
48 }ST_LLDP_RX_STATS, APP_FAR * LPST_LLDP_RX_STATS;
49 
50 
51 /* LLDP Rx Timers */
52 typedef struct _LLDP_RX_TIMERS {
53 
54  APP_WORD wRxInfoTTL; /* 802.1AB 10.5.3.2*/
55  APP_WORD wTooManyNeighborsTimer; /* 802.1AB 10.5.3.2*/
56 }ST_LLDP_RX_TIMERS, APP_FAR * LPST_LLDP_RX_TIMERS;
57 
58 
59 
60 /* LLDP RX State Machine */
61 typedef struct _LLDP_RX_SM {
62  /* 802.1AB 10.5.5.1*/
63  APP_BYTE byRxState;
64 
65  APP_BOOL bBadFrame; /* 802.1AB 10.5.5.1*/
66  APP_BOOL bRcvFrame; /* 802.1AB 10.5.5.1*/
67  APP_BOOL bRxChanges; /* 802.1AB 10.5.5.1*/
68  APP_BOOL bRxInfoAge; /* 802.1AB 10.5.5.1*/
69  APP_WORD wRxTTL; /* 802.1AB 10.5.5.1*/
70  APP_BOOL bTooManyNeighbors; /* 802.1AB 10.5.5.1*/
71  APP_BOOL bSomethingChangeRemote; /* 802.1AB 10.5.5.1*/
72 
73  APP_LPBYTE lpbyRxFrameBuffer; /* Buffer containing received frame */
74  APP_WORD wRxFrameLen; /* Len of received frame */
75  ST_LLDP_TLV stRxTLV[MAX_TLV_PER_LLDPDU]; /* List of received TLVs */
76 
77 
78 /*
79 
80  APP_LPBYTE lpbyCurrentFrameBuffer;
81  APP_WORD wRxFrameLen;
82 */
83  ST_LLDP_RX_STATS stLldpRxStats;
84  ST_LLDP_RX_TIMERS stLLDPRXTimers;
85 }ST_LLDP_RX_SM, APP_FAR * LPST_LLDP_RX_SM;
86 
87 
88 #endif
89 
90 
91 #endif
92 
93 
94 
95