Vector BLF
EthernetStatus.h
1 /*
2  * Copyright (C) 2013 Tobias Lorenz.
3  * Contact: tobias.lorenz@gmx.net
4  *
5  * This file is part of Tobias Lorenz's Toolkit.
6  *
7  * Commercial License Usage
8  * Licensees holding valid commercial licenses may use this file in
9  * accordance with the commercial license agreement provided with the
10  * Software or, alternatively, in accordance with the terms contained in
11  * a written agreement between you and Tobias Lorenz.
12  *
13  * GNU General Public License 3.0 Usage
14  * Alternatively, this file may be used under the terms of the GNU
15  * General Public License version 3.0 as published by the Free Software
16  * Foundation and appearing in the file LICENSE.GPL included in the
17  * packaging of this file. Please review the following information to
18  * ensure the GNU General Public License version 3.0 requirements will be
19  * met: http://www.gnu.org/copyleft/gpl.html.
20  */
21 
22 #pragma once
23 
24 #include <Vector/BLF/platform.h>
25 
26 #include <Vector/BLF/AbstractFile.h>
27 #include <Vector/BLF/ObjectHeader.h>
28 #include <Vector/BLF/VectorTypes.h>
29 
30 #include <Vector/BLF/vector_blf_export.h>
31 
32 namespace Vector {
33 namespace BLF {
34 
40 struct VECTOR_BLF_EXPORT EthernetStatus final : ObjectHeader {
42 
43  void read(AbstractFile & is) override;
44  void write(AbstractFile & os) override;
45  DWORD calculateObjectSize() const override;
46 
50  WORD channel {};
51 
53  enum Flags : WORD {
55  LinkStatus = 0x0001,
56 
58  Bitrate = 0x0002,
59 
61  EthernetPhy = 0x0004,
62 
64  Duplex = 0x0008,
65 
67  MdiType = 0x0010,
68 
70  Connector = 0x0020,
71 
73  ClockMode = 0x0040,
74 
76  BrPair = 0x0080,
77 
79  HardwareChannel = 0x0100,
80  };
81 
83  WORD flags;
84 
86  enum LinkStatus : BYTE {
88  UnknownLinkStatus = 0,
89 
91  LinkDown = 1,
92 
94  LinkUp = 2,
95 
97  Negotiate = 3,
98 
100  LinkError = 4
101  };
102 
106  BYTE linkStatus {};
107 
109  enum EthernetPhy : BYTE {
111  UnknownEthernetPhy = 0,
112 
114  Ieee802_3 = 1,
115 
117  BroadR_Reach = 2
118  };
119 
123  BYTE ethernetPhy {};
124 
126  enum Duplex : BYTE {
128  UnknownDuplex = 0,
129 
131  HalfDuplex = 1,
132 
134  FullDuplex = 2
135  };
136 
140  BYTE duplex {};
141 
143  enum Mdi : BYTE {
145  UnknownMdi = 0,
146 
148  Direct = 1,
149 
151  Crossover = 2
152  };
153 
155  BYTE mdi {};
156 
158  enum Connector : BYTE {
160  UnknownConnector = 0,
161 
163  Rj45 = 1,
164 
166  DSub = 2
167  };
168 
170  BYTE connector {};
171 
173  enum ClockMode : BYTE {
175  UnknownClockMode = 0,
176 
178  Master = 1,
179 
181  Slave = 2
182  };
183 
185  BYTE clockMode {};
186 
188  enum Pairs : BYTE {
190  UnknownPairs = 0,
191 
193  Br1Pair = 1,
194 
196  Br2Pair = 2,
197 
199  Br4Pair = 3
200  };
201 
203  BYTE pairs {};
204 
206  BYTE hardwareChannel {};
207 
211  DWORD bitrate {};
212 };
213 
214 }
215 }
Definition: AbstractFile.h:36
ETHERNET_STATUS.
Definition: EthernetStatus.h:40
Pairs
Definition: EthernetStatus.h:188
Flags
Definition: EthernetStatus.h:53
WORD flags
Definition: EthernetStatus.h:83
ClockMode
Definition: EthernetStatus.h:173
Duplex
Definition: EthernetStatus.h:126
EthernetPhy
Definition: EthernetStatus.h:109
LinkStatus
Definition: EthernetStatus.h:86
Connector
Definition: EthernetStatus.h:158
Mdi
Definition: EthernetStatus.h:143
Object header.
Definition: ObjectHeader.h:40