diff options
Diffstat (limited to 'packet/mrt.go')
-rw-r--r-- | packet/mrt.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packet/mrt.go b/packet/mrt.go index 369e8063..b259be7f 100644 --- a/packet/mrt.go +++ b/packet/mrt.go @@ -21,6 +21,7 @@ import ( "fmt" "math" "net" + "time" ) const ( @@ -139,6 +140,11 @@ func NewMRTHeader(timestamp uint32, t MRTType, subtype MRTSubTyper, l uint32) (* }, nil } +func (h *MRTHeader) GetTime() time.Time { + t := int64(h.Timestamp) + return time.Unix(t, 0) +} + type MRTMessage struct { Header MRTHeader Body Body |