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
d3f0e8c9
Commit
d3f0e8c9
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: Use a helper function to set the Oid with an IP address-based instance.
parent
e5afadab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
38 deletions
+23
-38
main.c
dlls/inetmib1/main.c
+23
-38
No files found.
dlls/inetmib1/main.c
View file @
d3f0e8c9
...
...
@@ -431,6 +431,25 @@ static AsnInteger32 getItemAndIpAddressInstanceFromOid(AsnObjectIdentifier *oid,
return
ret
;
}
static
void
setOidWithItemAndIpAddr
(
AsnObjectIdentifier
*
dst
,
AsnObjectIdentifier
*
base
,
UINT
item
,
DWORD
addr
)
{
UINT
id
;
BYTE
*
ptr
;
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
dst
,
base
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
id
;
id
=
item
;
SnmpUtilOidAppend
(
dst
,
&
oid
);
for
(
ptr
=
(
BYTE
*
)
&
addr
;
ptr
<
(
BYTE
*
)
&
addr
+
sizeof
(
DWORD
);
ptr
++
)
{
id
=
*
ptr
;
SnmpUtilOidAppend
(
dst
,
&
oid
);
}
}
static
struct
structToAsnValue
mib2IfEntryMap
[]
=
{
{
FIELD_OFFSET
(
MIB_IFROW
,
dwIndex
),
copyInt
},
{
FIELD_OFFSET
(
MIB_IFROW
,
dwDescrLen
),
copyLengthPrecededString
},
...
...
@@ -648,24 +667,8 @@ static BOOL mib2IpAddrQuery(BYTE bPduType, SnmpVarBind *pVarBind,
DEFINE_SIZEOF
(
mib2IpAddrMap
),
&
ipAddrTable
->
table
[
tableIndex
-
1
],
item
,
bPduType
,
pVarBind
);
if
(
!*
pErrorStatus
&&
bPduType
==
SNMP_PDU_GETNEXT
)
{
UINT
id
;
BYTE
*
ptr
;
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
&
pVarBind
->
name
,
&
myOid
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
id
;
id
=
item
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
for
(
ptr
=
(
BYTE
*
)
&
ipAddrTable
->
table
[
tableIndex
-
1
].
dwAddr
;
ptr
<
(
BYTE
*
)
&
ipAddrTable
->
table
[
tableIndex
-
1
].
dwAddr
+
sizeof
(
DWORD
);
ptr
++
)
{
id
=
*
ptr
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
}
}
setOidWithItemAndIpAddr
(
&
pVarBind
->
name
,
&
myOid
,
item
,
ipAddrTable
->
table
[
tableIndex
-
1
].
dwAddr
);
}
break
;
case
SNMP_PDU_SET
:
...
...
@@ -733,26 +736,8 @@ static BOOL mib2IpRouteQuery(BYTE bPduType, SnmpVarBind *pVarBind,
DEFINE_SIZEOF
(
mib2IpRouteMap
),
&
ipRouteTable
->
table
[
tableIndex
-
1
],
item
,
bPduType
,
pVarBind
);
if
(
!*
pErrorStatus
&&
bPduType
==
SNMP_PDU_GETNEXT
)
{
UINT
id
;
BYTE
*
ptr
;
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
&
pVarBind
->
name
,
&
myOid
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
id
;
id
=
item
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
for
(
ptr
=
(
BYTE
*
)
&
ipRouteTable
->
table
[
tableIndex
-
1
].
dwForwardDest
;
ptr
<
(
BYTE
*
)
&
ipRouteTable
->
table
[
tableIndex
-
1
].
dwForwardDest
+
sizeof
(
DWORD
);
ptr
++
)
{
id
=
*
ptr
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
}
}
setOidWithItemAndIpAddr
(
&
pVarBind
->
name
,
&
myOid
,
item
,
ipRouteTable
->
table
[
tableIndex
-
1
].
dwForwardDest
);
}
break
;
case
SNMP_PDU_SET
:
...
...
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