Skip to content

Commit

Permalink
Print EOR in the update type
Browse files Browse the repository at this point in the history
  • Loading branch information
omuravskiy committed Nov 18, 2021
1 parent b45c37c commit 0198547
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/javamrt/mrt/EndOfRib.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public String toString() {
String peerString = MRTConstants.ipAddressString(this.peerIP, false);
String attrString = updateAttr == null ? "" : updateAttr.toString();

return String.format("%s|%s||%s|%s|%s",
return String.format("%s|%s|EOR|%s|%s|%s",
updateStr, getTime(), peerString, peerAS, attrString);
}
}
4 changes: 2 additions & 2 deletions src/test/java/org/javamrt/mrt/MrtTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void should_parse_ipv4_end_of_rib() throws Exception {
final BGPFileReader bgpFileReader = new BGPFileReader(stream);
final MRTRecord mrtRecord = bgpFileReader.readNext();
assertEquals(mrtRecord.getClass(), EndOfRib.class);
assertEquals(mrtRecord.toString(), "BGP4MP|1527774250||187.16.220.193|263584|");
assertEquals(mrtRecord.toString(), "BGP4MP|1527774250|EOR|187.16.220.193|263584|");
}

@Test
Expand All @@ -186,6 +186,6 @@ public void should_parse_ipv6_end_of_rib() throws Exception {
final BGPFileReader bgpFileReader = new BGPFileReader(stream);
final MRTRecord mrtRecord = bgpFileReader.readNext();
assertEquals(mrtRecord.getClass(), EndOfRib.class);
assertEquals(mrtRecord.toString(), "BGP4MP|1527839889||2001:df0:2e8:1000:0:0:0:1|45896|||255.255.255.255|0|0||NAG||");
assertEquals(mrtRecord.toString(), "BGP4MP|1527839889|EOR|2001:df0:2e8:1000:0:0:0:1|45896|||255.255.255.255|0|0||NAG||");
}
}

0 comments on commit 0198547

Please sign in to comment.