Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
83
Issues
83
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
White Rabbit Switch - Software
Commits
9a7bfa6c
Commit
9a7bfa6c
authored
Jul 24, 2019
by
Maciej Lipinski
Committed by
Grzegorz Daniluk
Jan 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SNMP: filled in data of the new PtpInstanceTable
parent
02fb7296
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
106 additions
and
107 deletions
+106
-107
WR-SWITCH-MIB.txt
userspace/snmpd/WR-SWITCH-MIB.txt
+81
-90
wrsPtpInstanceTable.c
userspace/snmpd/wrsPtpInstanceTable.c
+20
-13
wrsPtpInstanceTable.h
userspace/snmpd/wrsPtpInstanceTable.h
+5
-4
No files found.
userspace/snmpd/WR-SWITCH-MIB.txt
View file @
9a7bfa6c
This diff is collapsed.
Click to expand it.
userspace/snmpd/wrsPtpInstanceTable.c
View file @
9a7bfa6c
...
...
@@ -25,7 +25,8 @@ static struct pickinfo wrsPtpInstanceTable_pickinfo[] = {
FIELD
(
wrsPtpInstanceTable_s
,
ASN_INTEGER
,
wrsPtpInstanceExtension
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_INTEGER
,
wrsPtpInstanceAsymEnabled
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_INTEGER
,
wrsPtpInstanceAsymConstAsym
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_COUNTER64
,
wrsPtpInstanceAsymConstAsym
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_COUNTER64
,
wrsPtpInstanceAsymConstAsymPS
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_COUNTER64
,
wrsPtpInstanceAsymScDelayCoef
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_OCTET_STR
,
wrsPtpInstanceAsymScDelayCoefHR
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_COUNTER64
,
wrsPtpInstanceTSCorrEgressLat
),
...
...
@@ -35,8 +36,7 @@ static struct pickinfo wrsPtpInstanceTable_pickinfo[] = {
FIELD
(
wrsPtpInstanceTable_s
,
ASN_COUNTER64
,
wrsPtpInstanceTSCorrSemistLat
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_COUNTER64
,
wrsPtpInstanceTSCorrSemistLatPS
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_INTEGER
,
wrsPtpInstancePtpSupport
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_INTEGER
,
wrsPtpInstanceExtEnabled
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_INTEGER
,
wrsPtpInstanceExtState
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_INTEGER
,
wrsPtpInstanceProtoDetectState
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_OCTET_STR
,
wrsPtpInstancePeerMac
),
FIELD
(
wrsPtpInstanceTable_s
,
ASN_INTEGER
,
wrsPtpInstancePeerVid
),
...
...
@@ -72,6 +72,7 @@ time_t wrsPtpInstanceTable_data_fill(unsigned int *n_rows)
int
instance_on_port
=
0
;
char
*
tmpstr_p
;
int
vlan_i
;
float
tmp_f
;
/* number of rows does not change for wrsPortStatusTable */
if
(
n_rows
)
...
...
@@ -143,25 +144,31 @@ time_t wrsPtpInstanceTable_data_fill(unsigned int *n_rows)
portDS_i
=
(
portDS_t
*
)
wrs_shm_follow
(
ppsi_head
,
ppsi_i
->
portDS
);
if
(
portDS_i
)
i_a
[
i
].
wrsPtpInstanceMasterOnly
=
portDS_i
->
masterOnly
;
i_a
[
i
].
wrsPtpInstanceMasterOnly
=
portDS_i
->
masterOnly
?
2
:
1
;
else
i_a
[
i
].
wrsPtpInstanceMasterOnly
=
0
;
i_a
[
i
].
wrsPtpInstanceExtPortCfgDesSt
=
ppsi_i
->
externalPortConfigurationPortDS
.
desiredState
;
i_a
[
i
].
wrsPtpInstanceMechanism
=
ppsi_i
->
delayMechanism
;
i_a
[
i
].
wrsPtpInstanceProfile
=
ppsi_i
->
cfg
.
profile
;
i_a
[
i
].
wrsPtpInstanceExtension
=
ppsi_i
->
protocol_extension
;
i_a
[
i
].
wrsPtpInstanceProfile
=
ppsi_i
->
cfg
.
profile
+
1
;
i_a
[
i
].
wrsPtpInstanceExtension
=
ppsi_i
->
protocol_extension
+
1
;
i_a
[
i
].
wrsPtpInstanceAsymEnabled
=
ppsi_i
->
asymmetryCorrectionPortDS
.
enable
+
1
;
i_a
[
i
].
wrsPtpInstanceAsymConstAsym
=
ppsi_i
->
asymmetryCorrectionPortDS
.
constantAsymmetry
;
i_a
[
i
].
wrsPtpInstanceAsymConstAsymPS
=
(
int64_t
)((((
float
)
ppsi_i
->
asymmetryCorrectionPortDS
.
constantAsymmetry
)
/
(
1
<<
16
))
*
1000
);
i_a
[
i
].
wrsPtpInstanceAsymScDelayCoef
=
ppsi_i
->
asymmetryCorrectionPortDS
.
scaledDelayCoefficient
;
//i_a[i].wrsPtpInstanceAsymScDelayCoefHR = ppsi_i->asymmetryCorrectionPortDS.scaledDelayCoefficient (string)
tmpstr_p
=
i_a
[
i
].
wrsPtpInstanceAsymScDelayCoefHR
;
tmp_f
=
((
float
)
ppsi_i
->
asymmetryCorrectionPortDS
.
scaledDelayCoefficient
)
/
((
1
<<
62
));
snprintf
(
tmpstr_p
,
64
,
"%f,"
,
tmp_f
);
i_a
[
i
].
wrsPtpInstanceTSCorrEgressLat
=
ppsi_i
->
timestampCorrectionPortDS
.
egressLatency
;
// i_a[i].wrsPtpInstanceTSCorrEgressLatPS = ppsi_i->timestampCorrectionPortDS.egressLatency (ps)
i_a
[
i
].
wrsPtpInstanceTSCorrEgressLatPS
=
(
int64_t
)((((
float
)
ppsi_i
->
timestampCorrectionPortDS
.
egressLatency
)
/
(
1
<<
16
))
*
1000
);
i_a
[
i
].
wrsPtpInstanceTSCorrIngLat
=
ppsi_i
->
timestampCorrectionPortDS
.
ingressLatency
;
// i_a[i].wrsPtpInstanceTSCorrIngLatPS = ppsi_i->timestampCorrectionPortDS.ingressLatency (ps)
i_a
[
i
].
wrsPtpInstanceTSCorrIngLatPS
=
(
int64_t
)((((
float
)
ppsi_i
->
timestampCorrectionPortDS
.
ingressLatency
)
/
(
1
<<
16
))
*
1000
);
i_a
[
i
].
wrsPtpInstanceTSCorrSemistLat
=
ppsi_i
->
timestampCorrectionPortDS
.
semistaticLatency
;
// i_a[i].wrsPtpInstanceTSCorrSemistLatPS = ppsi_i->timestampCorrectionPortDS.semistaticLatency (ps)(bitslide)
i_a
[
i
].
wrsPtpInstancePtpSupport
=
ppsi_i
->
ptp_support
;
i_a
[
i
].
wrsPtpInstance
ExtEnabled
=
ppsi_i
->
extState
;
i_a
[
i
].
wrsPtpInstance
ProtoDetectState
=
ppsi_i
->
pdstate
;
i_a
[
i
].
wrsPtpInstanceTSCorrSemistLatPS
=
(
int64_t
)((((
float
)
ppsi_i
->
timestampCorrectionPortDS
.
semistaticLatency
)
/
(
1
<<
16
))
*
1000
);
i_a
[
i
].
wrsPtpInstance
ProtoDetectState
=
ppsi_i
->
pdstate
+
1
;
i_a
[
i
].
wrsPtpInstance
ExtState
=
ppsi_i
->
extState
+
1
;
memcpy
(
i_a
[
i
].
wrsPtpInstancePeerMac
,
ppsi_i
->
peer
,
ETH_ALEN
);
i_a
[
i
].
wrsPtpInstancePeerVid
=
ppsi_i
->
peer_vid
;
...
...
userspace/snmpd/wrsPtpInstanceTable.h
View file @
9a7bfa6c
...
...
@@ -20,13 +20,15 @@ struct wrsPtpInstanceTable_s {
char
wrsPtpInstancePortName
[
16
];
/* port name on which ptp instance is running (wriX) */
int
wrsPtpInstanceState
;
int
wrsPtpInstanceMasterOnly
;
int
wrsPtpInstanceExtPortCfg
;
int
wrsPtpInstanceExtPortCfgDesSt
;
int
wrsPtpInstanceMechanism
;
/* ENDelayMechanism */
int
wrsPtpInstanceProfile
;
int
wrsPtpInstanceExtension
;
int
wrsPtpInstanceAsymEnabled
;
int
wrsPtpInstanceAsymConstAsym
;
int
wrsPtpInstanceAsymScDelayCoef
;
int64_t
wrsPtpInstanceAsymConstAsym
;
int64_t
wrsPtpInstanceAsymConstAsymPS
;
int64_t
wrsPtpInstanceAsymScDelayCoef
;
char
wrsPtpInstanceAsymScDelayCoefHR
[
64
];
int64_t
wrsPtpInstanceTSCorrEgressLat
;
int64_t
wrsPtpInstanceTSCorrEgressLatPS
;
...
...
@@ -34,8 +36,7 @@ struct wrsPtpInstanceTable_s {
int64_t
wrsPtpInstanceTSCorrIngLatPS
;
int64_t
wrsPtpInstanceTSCorrSemistLat
;
int64_t
wrsPtpInstanceTSCorrSemistLatPS
;
int
wrsPtpInstancePtpSupport
;
int
wrsPtpInstanceExtEnabled
;
int
wrsPtpInstanceExtState
;
int
wrsPtpInstanceProtoDetectState
;
char
wrsPtpInstancePeerMac
[
ETH_ALEN
];
int
wrsPtpInstancePeerVid
;
...
...
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