1/*
2 * LICENSE NOTICE.
3 *
4 * Use of the Microsoft Windows Rally Development Kit is covered under
5 * the Microsoft Windows Rally Development Kit License Agreement,
6 * which is provided within the Microsoft Windows Rally Development
7 * Kit or at http://www.microsoft.com/whdc/rally/rallykit.mspx. If you
8 * want a license from Microsoft to use the software in the Microsoft
9 * Windows Rally Development Kit, you must (1) complete the designated
10 * "licensee" information in the Windows Rally Development Kit License
11 * Agreement, and (2) sign and return the Agreement AS IS to Microsoft
12 * at the address provided in the Agreement.
13 */
14
15/*
16 * Copyright (c) Microsoft Corporation 2005.  All rights reserved.
17 * This software is provided with NO WARRANTY.
18 */
19
20/* This is the definition of the events that drive the State Machines */
21
22#ifndef	SMEVENT_H
23#define SMEVENT_H
24
25static const char * const smEvent_names[] =
26{
27    "PacketRcvd",
28    "DiscoverRcvd",
29    "EmitRcvd",
30    "ResetRcvd",
31    "BlockTimeout",
32    "ChargeTimeout",
33    "EmitTimeout",
34    "HelloDelayTimeout",
35    "InactivityTimeout",
36    "InvalidPacket"
37};
38
39typedef enum {
40    evtPacketRcvd,
41    evtDiscoverRcvd,
42    evtEmitRcvd,
43    evtResetRcvd,
44    evtBlockTimeout,
45    evtChargeTimeout,
46    evtEmitTimeout,
47    evtHelloDelayTimeout,
48    evtInactivityTimeout,
49    evtInvalidPacket		// marks the first of the invalid events
50} smEvent_t;
51
52typedef struct {
53    smEvent_t	evtType;
54    session_t  *ssn;		// NULL if unknown or not applicable
55    /* Knowledge of the packet, hoisted here to preclude multiple re-interpretations */
56    bool_t	   isNewSession;
57    bool_t	   isAckingMe;
58    bool_t	   isInternalEvt; // faked, as differing from a real packet or timeout
59    uint	   numDescrs;     // For an Emit packet, the count of its descriptors
60} protocol_event_t;
61
62#endif /*** SMEVENT_H ***/
63