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
32
Issues
32
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
c31ed5fd
Commit
c31ed5fd
authored
Mar 30, 2016
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/snmp: (no technical change) use __func__ instead of function's name
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
ce702625
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
snmp.c
lib/snmp.c
+7
-6
No files found.
lib/snmp.c
View file @
c31ed5fd
...
...
@@ -134,12 +134,12 @@ static int get_value(uint8_t *buf, uint8_t asn, void *p)
tmp
=
htonl
(
*
(
uint32_t
*
)
p
);
memcpy
(
oid_data
,
&
tmp
,
sizeof
(
tmp
));
*
len
=
sizeof
(
tmp
);
snmp_verbose
(
"
get_value 0x%x
\n
"
,
*
(
uint32_t
*
)
p
);
snmp_verbose
(
"
%s: 0x%x
\n
"
,
__func__
,
*
(
uint32_t
*
)
p
);
break
;
case
ASN_OCTET_STR
:
*
len
=
strnlen
((
char
*
)
p
,
MAX_OCTET_STR_LEN
-
1
);
memcpy
(
oid_data
,
p
,
*
len
+
1
);
snmp_verbose
(
"
get_value %s len %d
\n
"
,
(
char
*
)
p
,
*
len
);
snmp_verbose
(
"
%s: %s len %d
\n
"
,
__func__
,
(
char
*
)
p
,
*
len
);
break
;
default:
break
;
...
...
@@ -166,7 +166,7 @@ static int get_i32sat(uint8_t *buf, uint8_t asn, void *p) {
* otherwise pointers to the values will be overwritten */
tmp_int64
=
*
(
int64_t
*
)
p
;
/* gcc doesn't support printing 64bit values */
snmp_verbose
(
"
get_i32sat: 64bit value 0x%08x|%08x
\n
"
,
snmp_verbose
(
"
%s: 64bit value 0x%08x|%08x
\n
"
,
__func__
,
(
int32_t
)((
tmp_int64
)
>>
32
),
(
uint32_t
)
tmp_int64
);
/* saturate int32 */
if
(
tmp_int64
>=
INT_MAX
)
...
...
@@ -404,7 +404,8 @@ static uint8_t snmp_prepare_error(uint8_t *buf, uint8_t error)
buf
[
BYTE_ERROR_i
+
community_len
]
=
error
;
buf
[
BYTE_ERROR_INDEX_i
+
community_len
]
=
1
;
ret_size
=
buf
[
BYTE_PACKET_SIZE_i
]
+
2
;
snmp_verbose
(
"%s: error returning %i bytes
\n
"
,
__func__
,
ret_size
);
snmp_verbose
(
"%s: error returning %i bytes
\n
"
,
__func__
,
ret_size
);
return
ret_size
;
}
...
...
@@ -556,8 +557,8 @@ static int snmp_respond(uint8_t *buf)
buf
[
i
]
=
SNMP_GET_RESPONSE
;
if
(
match_array
[
i
]
!=
BYTE_SIZE
)
continue
;
snmp_verbose
(
"offset %i 0x%02x is len %i
\n
"
,
i
,
i
,
remain
);
snmp_verbose
(
"
%s:
offset %i 0x%02x is len %i
\n
"
,
i
,
i
,
__func__
,
remain
);
buf
[
i
]
=
remain
;
}
snmp_verbose
(
"%s: returning %i bytes
\n
"
,
__func__
,
newbuf
-
buf
);
...
...
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