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
632b759f
Commit
632b759f
authored
Dec 07, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Dec 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetmib1: Return error value from MIB copy functions.
parent
7060f896
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
main.c
dlls/inetmib1/main.c
+10
-7
No files found.
dlls/inetmib1/main.c
View file @
632b759f
...
@@ -32,10 +32,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(inetmib1);
...
@@ -32,10 +32,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(inetmib1);
/**
/**
* Utility functions
* Utility functions
*/
*/
static
void
copyInt
(
AsnAny
*
value
,
void
*
src
)
static
DWORD
copyInt
(
AsnAny
*
value
,
void
*
src
)
{
{
value
->
asnType
=
ASN_INTEGER
;
value
->
asnType
=
ASN_INTEGER
;
value
->
asnValue
.
number
=
*
(
DWORD
*
)
src
;
value
->
asnValue
.
number
=
*
(
DWORD
*
)
src
;
return
SNMP_ERRORSTATUS_NOERROR
;
}
}
static
void
setStringValue
(
AsnAny
*
value
,
BYTE
type
,
DWORD
len
,
BYTE
*
str
)
static
void
setStringValue
(
AsnAny
*
value
,
BYTE
type
,
DWORD
len
,
BYTE
*
str
)
...
@@ -49,14 +50,15 @@ static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str)
...
@@ -49,14 +50,15 @@ static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str)
SnmpUtilAsnAnyCpy
(
value
,
&
strValue
);
SnmpUtilAsnAnyCpy
(
value
,
&
strValue
);
}
}
static
void
copyLengthPrecededString
(
AsnAny
*
value
,
void
*
src
)
static
DWORD
copyLengthPrecededString
(
AsnAny
*
value
,
void
*
src
)
{
{
DWORD
len
=
*
(
DWORD
*
)
src
;
DWORD
len
=
*
(
DWORD
*
)
src
;
setStringValue
(
value
,
ASN_OCTETSTRING
,
len
,
(
BYTE
*
)
src
+
sizeof
(
DWORD
));
setStringValue
(
value
,
ASN_OCTETSTRING
,
len
,
(
BYTE
*
)
src
+
sizeof
(
DWORD
));
return
SNMP_ERRORSTATUS_NOERROR
;
}
}
typedef
void
(
*
copyValueFunc
)(
AsnAny
*
value
,
void
*
src
);
typedef
DWORD
(
*
copyValueFunc
)(
AsnAny
*
value
,
void
*
src
);
struct
structToAsnValue
struct
structToAsnValue
{
{
...
@@ -75,13 +77,13 @@ static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map,
...
@@ -75,13 +77,13 @@ static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map,
return
SNMP_ERRORSTATUS_NOSUCHNAME
;
return
SNMP_ERRORSTATUS_NOSUCHNAME
;
if
(
!
map
[
id
].
copy
)
if
(
!
map
[
id
].
copy
)
return
SNMP_ERRORSTATUS_NOSUCHNAME
;
return
SNMP_ERRORSTATUS_NOSUCHNAME
;
map
[
id
].
copy
(
&
pVarBind
->
value
,
(
BYTE
*
)
record
+
map
[
id
].
offset
);
return
map
[
id
].
copy
(
&
pVarBind
->
value
,
(
BYTE
*
)
record
+
map
[
id
].
offset
);
return
SNMP_ERRORSTATUS_NOERROR
;
}
}
static
void
copyIpAddr
(
AsnAny
*
value
,
void
*
src
)
static
DWORD
copyIpAddr
(
AsnAny
*
value
,
void
*
src
)
{
{
setStringValue
(
value
,
ASN_IPADDRESS
,
sizeof
(
DWORD
),
src
);
setStringValue
(
value
,
ASN_IPADDRESS
,
sizeof
(
DWORD
),
src
);
return
SNMP_ERRORSTATUS_NOERROR
;
}
}
static
UINT
mib2
[]
=
{
1
,
3
,
6
,
1
,
2
,
1
};
static
UINT
mib2
[]
=
{
1
,
3
,
6
,
1
,
2
,
1
};
...
@@ -168,7 +170,7 @@ static BOOL mib2IfNumberQuery(BYTE bPduType, SnmpVarBind *pVarBind,
...
@@ -168,7 +170,7 @@ static BOOL mib2IfNumberQuery(BYTE bPduType, SnmpVarBind *pVarBind,
return
ret
;
return
ret
;
}
}
static
void
copyOperStatus
(
AsnAny
*
value
,
void
*
src
)
static
DWORD
copyOperStatus
(
AsnAny
*
value
,
void
*
src
)
{
{
value
->
asnType
=
ASN_INTEGER
;
value
->
asnType
=
ASN_INTEGER
;
/* The IPHlpApi definition of operational status differs from the MIB2 one,
/* The IPHlpApi definition of operational status differs from the MIB2 one,
...
@@ -186,6 +188,7 @@ static void copyOperStatus(AsnAny *value, void *src)
...
@@ -186,6 +188,7 @@ static void copyOperStatus(AsnAny *value, void *src)
default:
default:
value
->
asnValue
.
number
=
MIB_IF_ADMIN_STATUS_DOWN
;
value
->
asnValue
.
number
=
MIB_IF_ADMIN_STATUS_DOWN
;
};
};
return
SNMP_ERRORSTATUS_NOERROR
;
}
}
/* Given an OID and a base OID that it must begin with, finds the item and
/* Given an OID and a base OID that it must begin with, finds the item and
...
...
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