-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathifmib.py
More file actions
81 lines (62 loc) · 2.07 KB
/
Copy pathifmib.py
File metadata and controls
81 lines (62 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""++
Copyright (c) Microsoft Corporation
Module Name:
ifmib.h
Abstract:
This module contains the public definitions and structures for the
non-TCP/IP specific parts of MIB-II. These definitions were previously
in iprtrmib.h, which now includes this file.
--"""
from . import cpreproc
from .minwindef import *
from .winnt import UCHAR
if cpreproc.pragma_once("_IFMIB_"):
from .ifdef import *
ANY_SIZE = 1
class MIB_IFNUMBER(CStructure):
_fields_ = [
("dwValue", DWORD)
]
PMIB_IFNUMBER = POINTER(MIB_IFNUMBER)
#
# $REVIEW: This has always been defined as 8. However, this is not
# sufficient for all media types.
#
MAXLEN_PHYSADDR = 8
MAXLEN_IFDESCR = 256
MAX_INTERFACE_NAME_LEN = 256
class MIB_IFROW(CStructure):
_fields_ = [
("wszName", WCHAR * MAX_INTERFACE_NAME_LEN),
("dwIndex", IF_INDEX),
("dwType", IFTYPE),
("dwMtu", DWORD),
("dwSpeed", DWORD),
("dwPhysAddrLen", DWORD),
("bPhysAddr", UCHAR * MAXLEN_PHYSADDR),
("dwAdminStatus", DWORD),
("dwOperStatus", INTERNAL_IF_OPER_STATUS),
("dwLastChange", DWORD),
("dwInOctets", DWORD),
("dwInUcastPkts", DWORD),
("dwInNUcastPkts", DWORD),
("dwInDiscards", DWORD),
("dwInErrors", DWORD),
("dwInUnknownProtos", DWORD),
("dwOutOctets", DWORD),
("dwOutUcastPkts", DWORD),
("dwOutNUcastPkts", DWORD),
("dwOutDiscards", DWORD),
("dwOutErrors", DWORD),
("dwOutQLen", DWORD),
("dwDescrLen", DWORD),
("bDescr", UCHAR * MAXLEN_IFDESCR)
]
PMIB_IFROW = POINTER(MIB_IFROW)
class MIB_IFTABLE(CStructure):
_fields_ = [
("dwNumEntries", DWORD),
("table", MIB_IFROW * ANY_SIZE)
]
PMIB_IFTABLE = POINTER(MIB_IFTABLE)
SIZEOF_IFTABLE = lambda X: MIB_IFTABLE.table.offset + (X) * sizeof(MIB_IFROW) + MIB_IFTABLE._pack_