add stringer methods

This commit is contained in:
soypat
2025-02-20 23:41:27 -03:00
parent c9d1c4f239
commit d996040d92
6 changed files with 43 additions and 4 deletions
+3 -1
View File
@@ -174,8 +174,10 @@ func (frm Frame) ClearHeader() {
}
func (tfrm Frame) String() string {
src := tfrm.SourcePort()
dst := tfrm.DestinationPort()
seg := tfrm.Segment(len(tfrm.Payload()))
return fmt.Sprintf("%+v", seg)
return fmt.Sprintf("TCP :%d -> :%d %s", src, dst, seg.String())
}
//