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
0fb70c6d
Commit
0fb70c6d
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 item.
parent
81b0db24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
31 deletions
+19
-31
main.c
dlls/inetmib1/main.c
+19
-31
No files found.
dlls/inetmib1/main.c
View file @
0fb70c6d
...
@@ -431,11 +431,10 @@ static AsnInteger32 getItemAndIpAddressInstanceFromOid(AsnObjectIdentifier *oid,
...
@@ -431,11 +431,10 @@ static AsnInteger32 getItemAndIpAddressInstanceFromOid(AsnObjectIdentifier *oid,
return
ret
;
return
ret
;
}
}
static
void
setOidWithItem
AndIpAddr
(
AsnObjectIdentifier
*
dst
,
static
void
setOidWithItem
(
AsnObjectIdentifier
*
dst
,
AsnObjectIdentifier
*
base
,
AsnObjectIdentifier
*
base
,
UINT
item
,
DWORD
addr
)
UINT
item
)
{
{
UINT
id
;
UINT
id
;
BYTE
*
ptr
;
AsnObjectIdentifier
oid
;
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
dst
,
base
);
SnmpUtilOidCpy
(
dst
,
base
);
...
@@ -443,6 +442,18 @@ static void setOidWithItemAndIpAddr(AsnObjectIdentifier *dst,
...
@@ -443,6 +442,18 @@ static void setOidWithItemAndIpAddr(AsnObjectIdentifier *dst,
oid
.
ids
=
&
id
;
oid
.
ids
=
&
id
;
id
=
item
;
id
=
item
;
SnmpUtilOidAppend
(
dst
,
&
oid
);
SnmpUtilOidAppend
(
dst
,
&
oid
);
}
static
void
setOidWithItemAndIpAddr
(
AsnObjectIdentifier
*
dst
,
AsnObjectIdentifier
*
base
,
UINT
item
,
DWORD
addr
)
{
UINT
id
;
BYTE
*
ptr
;
AsnObjectIdentifier
oid
;
setOidWithItem
(
dst
,
base
,
item
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
id
;
for
(
ptr
=
(
BYTE
*
)
&
addr
;
ptr
<
(
BYTE
*
)
&
addr
+
sizeof
(
DWORD
);
ptr
++
)
for
(
ptr
=
(
BYTE
*
)
&
addr
;
ptr
<
(
BYTE
*
)
&
addr
+
sizeof
(
DWORD
);
ptr
++
)
{
{
id
=
*
ptr
;
id
=
*
ptr
;
...
@@ -455,10 +466,8 @@ static void setOidWithItemAndInteger(AsnObjectIdentifier *dst,
...
@@ -455,10 +466,8 @@ static void setOidWithItemAndInteger(AsnObjectIdentifier *dst,
{
{
AsnObjectIdentifier
oid
;
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
dst
,
base
);
setOidWithItem
(
dst
,
base
,
item
);
oid
.
idLength
=
1
;
oid
.
idLength
=
1
;
oid
.
ids
=
&
item
;
SnmpUtilOidAppend
(
dst
,
&
oid
);
oid
.
ids
=
&
instance
;
oid
.
ids
=
&
instance
;
SnmpUtilOidAppend
(
dst
,
&
oid
);
SnmpUtilOidAppend
(
dst
,
&
oid
);
}
}
...
@@ -597,14 +606,7 @@ static BOOL mib2IpStatsQuery(BYTE bPduType, SnmpVarBind *pVarBind,
...
@@ -597,14 +606,7 @@ static BOOL mib2IpStatsQuery(BYTE bPduType, SnmpVarBind *pVarBind,
*
pErrorStatus
=
mapStructEntryToValue
(
mib2IpMap
,
*
pErrorStatus
=
mapStructEntryToValue
(
mib2IpMap
,
DEFINE_SIZEOF
(
mib2IpMap
),
&
ipStats
,
item
,
bPduType
,
pVarBind
);
DEFINE_SIZEOF
(
mib2IpMap
),
&
ipStats
,
item
,
bPduType
,
pVarBind
);
if
(
!*
pErrorStatus
&&
bPduType
==
SNMP_PDU_GETNEXT
)
if
(
!*
pErrorStatus
&&
bPduType
==
SNMP_PDU_GETNEXT
)
{
setOidWithItem
(
&
pVarBind
->
name
,
&
myOid
,
item
);
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
&
pVarBind
->
name
,
&
myOid
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
item
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
}
}
}
break
;
break
;
case
SNMP_PDU_SET
:
case
SNMP_PDU_SET
:
...
@@ -875,15 +877,8 @@ static BOOL mib2IcmpQuery(BYTE bPduType, SnmpVarBind *pVarBind,
...
@@ -875,15 +877,8 @@ static BOOL mib2IcmpQuery(BYTE bPduType, SnmpVarBind *pVarBind,
*
pErrorStatus
=
mapStructEntryToValue
(
mib2IcmpMap
,
*
pErrorStatus
=
mapStructEntryToValue
(
mib2IcmpMap
,
DEFINE_SIZEOF
(
mib2IcmpMap
),
&
icmpStats
,
item
,
bPduType
,
DEFINE_SIZEOF
(
mib2IcmpMap
),
&
icmpStats
,
item
,
bPduType
,
pVarBind
);
pVarBind
);
if
(
!*
pErrorStatus
)
if
(
!*
pErrorStatus
&&
bPduType
==
SNMP_PDU_GETNEXT
)
{
setOidWithItem
(
&
pVarBind
->
name
,
&
myOid
,
item
);
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
&
pVarBind
->
name
,
&
myOid
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
item
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
}
}
}
break
;
break
;
case
SNMP_PDU_SET
:
case
SNMP_PDU_SET
:
...
@@ -942,14 +937,7 @@ static BOOL mib2TcpQuery(BYTE bPduType, SnmpVarBind *pVarBind,
...
@@ -942,14 +937,7 @@ static BOOL mib2TcpQuery(BYTE bPduType, SnmpVarBind *pVarBind,
*
pErrorStatus
=
mapStructEntryToValue
(
mib2TcpMap
,
*
pErrorStatus
=
mapStructEntryToValue
(
mib2TcpMap
,
DEFINE_SIZEOF
(
mib2TcpMap
),
&
tcpStats
,
item
,
bPduType
,
pVarBind
);
DEFINE_SIZEOF
(
mib2TcpMap
),
&
tcpStats
,
item
,
bPduType
,
pVarBind
);
if
(
!*
pErrorStatus
&&
bPduType
==
SNMP_PDU_GETNEXT
)
if
(
!*
pErrorStatus
&&
bPduType
==
SNMP_PDU_GETNEXT
)
{
setOidWithItem
(
&
pVarBind
->
name
,
&
myOid
,
item
);
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
&
pVarBind
->
name
,
&
myOid
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
item
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
}
}
}
break
;
break
;
case
SNMP_PDU_SET
:
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