Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
81b0db24
Commit
81b0db24
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 integer instance.
parent
d3f0e8c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
28 deletions
+17
-28
main.c
dlls/inetmib1/main.c
+17
-28
No files found.
dlls/inetmib1/main.c
View file @
81b0db24
...
...
@@ -450,6 +450,19 @@ static void setOidWithItemAndIpAddr(AsnObjectIdentifier *dst,
}
}
static
void
setOidWithItemAndInteger
(
AsnObjectIdentifier
*
dst
,
AsnObjectIdentifier
*
base
,
UINT
item
,
UINT
instance
)
{
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
dst
,
base
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
item
;
SnmpUtilOidAppend
(
dst
,
&
oid
);
oid
.
ids
=
&
instance
;
SnmpUtilOidAppend
(
dst
,
&
oid
);
}
static
struct
structToAsnValue
mib2IfEntryMap
[]
=
{
{
FIELD_OFFSET
(
MIB_IFROW
,
dwIndex
),
copyInt
},
{
FIELD_OFFSET
(
MIB_IFROW
,
dwDescrLen
),
copyLengthPrecededString
},
...
...
@@ -514,23 +527,8 @@ static BOOL mib2IfEntryQuery(BYTE bPduType, SnmpVarBind *pVarBind,
&
ifTable
->
table
[
tableIndex
-
1
],
item
,
bPduType
,
pVarBind
);
if
(
bPduType
==
SNMP_PDU_GETNEXT
)
{
AsnObjectIdentifier
oid
;
SnmpUtilOidCpy
(
&
pVarBind
->
name
,
&
entryOid
);
oid
.
idLength
=
1
;
oid
.
ids
=
&
item
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
/* According to RFC1158, the value of the interface
* index must vary between 1 and ifNumber (the number
* of interfaces), so use the 1-based table index
* directly, rather than assuming that IPHlpApi's
* dwIndex will have the correct range.
*/
oid
.
idLength
=
1
;
oid
.
ids
=
&
tableIndex
;
SnmpUtilOidAppend
(
&
pVarBind
->
name
,
&
oid
);
}
setOidWithItemAndInteger
(
&
pVarBind
->
name
,
&
entryOid
,
item
,
tableIndex
);
}
}
}
...
...
@@ -804,17 +802,8 @@ static BOOL mib2IpNetQuery(BYTE bPduType, SnmpVarBind *pVarBind,
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
);
}
setOidWithItemAndInteger
(
&
pVarBind
->
name
,
&
myOid
,
item
,
tableIndex
);
}
}
}
...
...
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