winapi_ui_automation/shared/
ifmib.rs

1// Licensed under the Apache License, Version 2.0
2// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4// All files in the project carrying such notice may not be copied, modified, or distributed
5// except according to those terms.
6//! Contains the public definitions and structures for the non-TCP/IP specific parts of MIB-II.
7// #include <winapifamily.h>
8// #include <ifdef.h>
9use shared::ifdef::IF_INDEX;
10use shared::ipifcons::{IFTYPE, INTERNAL_IF_OPER_STATUS};
11use shared::minwindef::DWORD;
12use shared::ntdef::{UCHAR, WCHAR};
13const ANY_SIZE: usize = 1;
14STRUCT!{struct MIB_IFNUMBER {
15    dwValue: DWORD,
16}}
17pub type PMIB_IFNUMBER = *mut MIB_IFNUMBER;
18pub const MAXLEN_PHYSADDR: usize = 8;
19pub const MAXLEN_IFDESCR: usize = 256;
20pub const MAX_INTERFACE_NAME_LEN: usize = 256;
21STRUCT!{struct MIB_IFROW {
22    wszName: [WCHAR; MAX_INTERFACE_NAME_LEN],
23    dwIndex: IF_INDEX,
24    dwType: IFTYPE,
25    dwMtu: DWORD,
26    dwSpeed: DWORD,
27    dwPhysAddrLen: DWORD,
28    bPhysAddr: [UCHAR; MAXLEN_PHYSADDR],
29    dwAdminStatus: DWORD,
30    dwOperStatus: INTERNAL_IF_OPER_STATUS,
31    dwLastChange: DWORD,
32    dwInOctets: DWORD,
33    dwInUcastPkts: DWORD,
34    dwInNUcastPkts: DWORD,
35    dwInDiscards: DWORD,
36    dwInErrors: DWORD,
37    dwInUnknownProtos: DWORD,
38    dwOutOctets: DWORD,
39    dwOutUcastPkts: DWORD,
40    dwOutNUcastPkts: DWORD,
41    dwOutDiscards: DWORD,
42    dwOutErrors: DWORD,
43    dwOutQLen: DWORD,
44    dwDescrLen: DWORD,
45    bDescr: [UCHAR; MAXLEN_IFDESCR],
46}}
47pub type PMIB_IFROW = *mut MIB_IFROW;
48STRUCT!{struct MIB_IFTABLE {
49    dwNumEntries: DWORD,
50    table: [MIB_IFROW; ANY_SIZE],
51}}
52pub type PMIB_IFTABLE = *mut MIB_IFTABLE;
53// FIXME: SIZEOF_IFTABLE(x)