Skip to content

Commit

Permalink
rtrdump: add sessionid and serial to json output
Browse files Browse the repository at this point in the history
To diagnose RTR issues its very useful to have access to
sessionid and serial fields.

Discussed in #102
  • Loading branch information
lukastribus committed Nov 1, 2024
1 parent 5fe99a5 commit 5b7dfc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/rtrdump/rtrdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ func (c *Client) HandlePDU(cs *rtr.ClientSession, pdu rtr.PDU) {
log.Debugf("Received: %v", pdu)
}
case *rtr.PDUEndOfData:
c.Data.Metadata.SessionID = int(pdu.SessionId)
c.Data.Metadata.Serial = int(pdu.SerialNumber)
cs.Disconnect()
log.Debugf("Received: %v", pdu)
case *rtr.PDUCacheResponse:
Expand Down
2 changes: 2 additions & 0 deletions prefixfile/prefixfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type MetaData struct {
CountBgpSecKeys int `json:"bgpsec_pubkeys"`
Buildtime string `json:"buildtime,omitempty"`
GeneratedUnix *int64 `json:"generated,omitempty"`
SessionID int `json:"sessionid,omitempty"`
Serial int `json:"serial"`
}

type VRPJson struct {
Expand Down

0 comments on commit 5b7dfc9

Please sign in to comment.