Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
31
Issues
31
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
f2773135
Commit
f2773135
authored
Mar 04, 2016
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/snmp: add function printing OID
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
f451742e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
snmp.c
lib/snmp.c
+12
-2
No files found.
lib/snmp.c
View file @
f2773135
...
...
@@ -205,6 +205,15 @@ static uint8_t match_array[] = {
0x06
,
BYTE_IGNORE
,
/* oid follows */
};
static
void
print_oid_verbose
(
uint8_t
*
oid
,
int
len
)
{
/*uint8_t * oid_end = oid + len;*/
int
i
;
snmp_verbose
(
".1.3"
);
for
(
i
=
1
;
i
<
len
;
i
++
)
snmp_verbose
(
".%d"
,
*
(
oid
+
i
));
}
/* And, now, work out your generic frame responder... */
static
int
snmp_respond
(
uint8_t
*
buf
)
{
...
...
@@ -233,8 +242,9 @@ static int snmp_respond(uint8_t *buf)
break
;
if
(
!
oid
->
oid_len
)
return
-
1
;
snmp_verbose
(
"%s: oid found: calling %p
\n
"
,
__func__
,
oid
->
fill
);
snmp_verbose
(
"%s: oid found: "
,
__func__
);
print_oid_verbose
(
oid
->
oid_match
,
oid
->
oid_len
);
snmp_verbose
(
" calling %p
\n
"
,
oid
->
fill
);
/* Phew.... we matched the OID, so let's call the filler */
newbuf
+=
oid
->
oid_len
;
len
=
oid
->
fill
(
newbuf
,
oid
);
...
...
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