Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
e5afadab
Commit
e5afadab
authored
Jun 25, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Jun 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetmib1: Support the MIB2 IP net (ARP) table.
parent
d3baf1dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
0 deletions
+80
-0
main.c
dlls/inetmib1/main.c
+80
-0
No files found.
dlls/inetmib1/main.c
View file @
e5afadab
...
@@ -765,6 +765,85 @@ static BOOL mib2IpRouteQuery(BYTE bPduType, SnmpVarBind *pVarBind,
...
@@ -765,6 +765,85 @@ static BOOL mib2IpRouteQuery(BYTE bPduType, SnmpVarBind *pVarBind,
return
TRUE
;
return
TRUE
;
}
}
static
UINT
mib2IpNet
[]
=
{
1
,
3
,
6
,
1
,
2
,
1
,
4
,
22
,
1
};
static
PMIB_IPNETTABLE
ipNetTable
;
static
struct
structToAsnValue
mib2IpNetMap
[]
=
{
{
FIELD_OFFSET
(
MIB_IPNETROW
,
dwIndex
),
copyInt
},
{
FIELD_OFFSET
(
MIB_IPNETROW
,
dwPhysAddrLen
),
copyLengthPrecededString
},
{
FIELD_OFFSET
(
MIB_IPNETROW
,
dwAddr
),
copyIpAddr
},
{
FIELD_OFFSET
(
MIB_IPNETROW
,
dwType
),
copyInt
},
};
static
void
mib2IpNetInit
(
void
)
{
DWORD
size
=
0
,
ret
=
GetIpNetTable
(
NULL
,
&
size
,
FALSE
);
if
(
ret
==
ERROR_INSUFFICIENT_BUFFER
)
{
ipNetTable
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
ipNetTable
)
GetIpNetTable
(
ipNetTable
,
&
size
,
FALSE
);
}
}
static
BOOL
mib2IpNetQuery
(
BYTE
bPduType
,
SnmpVarBind
*
pVarBind
,
AsnInteger32
*
pErrorStatus
)
{
AsnObjectIdentifier
myOid
=
DEFINE_OID
(
mib2IpNet
);
TRACE
(
"(0x%02x, %s, %p)
\n
"
,
bPduType
,
SnmpUtilOidToA
(
&
pVarBind
->
name
),
pErrorStatus
);
switch
(
bPduType
)
{
case
SNMP_PDU_GET
:
case
SNMP_PDU_GETNEXT
:
if
(
!
ipNetTable
)
*
pErrorStatus
=
SNMP_ERRORSTATUS_NOSUCHNAME
;
else
{
UINT
tableIndex
=
0
,
item
=
0
;
*
pErrorStatus
=
getItemAndIntegerInstanceFromOid
(
&
pVarBind
->
name
,
&
myOid
,
bPduType
,
&
item
,
&
tableIndex
);
if
(
!*
pErrorStatus
)
{
assert
(
tableIndex
);
assert
(
item
);
if
(
tableIndex
>
ipNetTable
->
dwNumEntries
)
*
pErrorStatus
=
SNMP_ERRORSTATUS_NOSUCHNAME
;
else
{
*
pErrorStatus
=
mapStructEntryToValue
(
mib2IpNetMap
,
DEFINE_SIZEOF
(
mib2IpNetMap
),
&
ipNetTable
[
tableIndex
-
1
],
item
,
bPduType
,
pVarBind
);
if
(
!*
pErrorStatus
&&
bPduType
==
SNMP_PDU_GETNEXT
)
{
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
&
pVarBind
->
name
,
&
myOid
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
item
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
tableIndex
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
}
}
}
}
break
;
case
SNMP_PDU_SET
:
*
pErrorStatus
=
SNMP_ERRORSTATUS_READONLY
;
break
;
default:
FIXME
(
"0x%02x: unsupported PDU type
\n
"
,
bPduType
);
*
pErrorStatus
=
SNMP_ERRORSTATUS_NOSUCHNAME
;
}
return
TRUE
;
}
static
UINT
mib2Icmp
[]
=
{
1
,
3
,
6
,
1
,
2
,
1
,
5
};
static
UINT
mib2Icmp
[]
=
{
1
,
3
,
6
,
1
,
2
,
1
,
5
};
static
MIB_ICMP
icmpStats
;
static
MIB_ICMP
icmpStats
;
...
@@ -916,6 +995,7 @@ static struct mibImplementation supportedIDs[] = {
...
@@ -916,6 +995,7 @@ static struct mibImplementation supportedIDs[] = {
{
DEFINE_OID
(
mib2Ip
),
mib2IpStatsInit
,
mib2IpStatsQuery
},
{
DEFINE_OID
(
mib2Ip
),
mib2IpStatsInit
,
mib2IpStatsQuery
},
{
DEFINE_OID
(
mib2IpAddr
),
mib2IpAddrInit
,
mib2IpAddrQuery
},
{
DEFINE_OID
(
mib2IpAddr
),
mib2IpAddrInit
,
mib2IpAddrQuery
},
{
DEFINE_OID
(
mib2IpRoute
),
mib2IpRouteInit
,
mib2IpRouteQuery
},
{
DEFINE_OID
(
mib2IpRoute
),
mib2IpRouteInit
,
mib2IpRouteQuery
},
{
DEFINE_OID
(
mib2IpNet
),
mib2IpNetInit
,
mib2IpNetQuery
},
{
DEFINE_OID
(
mib2Icmp
),
mib2IcmpInit
,
mib2IcmpQuery
},
{
DEFINE_OID
(
mib2Icmp
),
mib2IcmpInit
,
mib2IcmpQuery
},
{
DEFINE_OID
(
mib2Tcp
),
mib2TcpInit
,
mib2TcpQuery
},
{
DEFINE_OID
(
mib2Tcp
),
mib2TcpInit
,
mib2TcpQuery
},
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment