|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--SSF.OS.OSPFv2.test.OSPFMonitor
Implements a tcpDump utility for OSPF protocol traffic. Some of the code for writing binary tcpdump files is "stolen" from SSF.OS.binaryTcpDump. The monitor is used from an IP session, so it also gets all non-OSPF packets. For simplicity, these are simply ignored.
| Field Summary | |
private java.lang.String |
fileName
Name of the binary tcpdump file |
private SSF.OS.ProtocolSession |
ipSession
Pointer to the IP session |
private java.io.FileOutputStream |
outstream
File to write the tcpdump to. |
private byte[] |
rbuf
|
private int |
rct
|
| Constructor Summary | |
OSPFMonitor()
Constructor. |
|
| Method Summary | |
void |
config(SSF.OS.ProtocolSession ownerProtocol,
com.renesys.raceway.DML.Configuration cfg)
configure the Monitor ProtocolSession[ name ip use SSF.OS.IP monitor[ use SSF.OS.OSPFv2.test.OSPFMonitor file |
private void |
dump_ospf_lsa(SSF.OS.OSPFv2.LSA lsa)
Dumps a single OSPF LSA |
private void |
dump_ospf_packet(SSF.OS.OSPFv2.Packet ospfHdr)
Dumps an OSPF packet |
private void |
dump(SSF.OS.PacketEvent pe)
Dump a single packet event |
private byte |
getOspfOptions(boolean[] opts)
Creates an OSPF options byte from a bool array |
void |
init()
Initialize the monitor. |
private void |
raw_commit()
Write buffered bytes to the printstream |
private void |
raw(int len,
long val)
Write 1, 2, or 4 bytes to buffer in network byte order |
private void |
rawh(int len,
long val)
Write 1, 2, or 4 bytes to buffer in host order |
private void |
rawPacket(SSF.OS.PacketEvent pkt,
long atTime)
Write raw packet bytes to the output stream. |
void |
receive(SSF.OS.ProtocolMessage packet,
SSF.OS.ProtocolSession fromSession,
SSF.OS.ProtocolSession toSession)
peek at every IP packet push()ed into IP |
private void |
write_raw_file_header()
Write the generic file header for TCP binary dump files |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private java.io.FileOutputStream outstream
private SSF.OS.ProtocolSession ipSession
private java.lang.String fileName
private byte[] rbuf
private int rct
| Constructor Detail |
public OSPFMonitor()
| Method Detail |
public void config(SSF.OS.ProtocolSession ownerProtocol,
com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
ProtocolSession[ name ip use SSF.OS.IP
monitor[ use SSF.OS.OSPFv2.test.OSPFMonitor
file
]
]
config in interface SSF.OS.ProtocolMonitorpublic void init()
init in interface SSF.OS.ProtocolMonitor
public void receive(SSF.OS.ProtocolMessage packet,
SSF.OS.ProtocolSession fromSession,
SSF.OS.ProtocolSession toSession)
receive in interface SSF.OS.ProtocolMonitorprivate void dump(SSF.OS.PacketEvent pe)
private void rawPacket(SSF.OS.PacketEvent pkt,
long atTime)
private void dump_ospf_packet(SSF.OS.OSPFv2.Packet ospfHdr)
private void dump_ospf_lsa(SSF.OS.OSPFv2.LSA lsa)
private byte getOspfOptions(boolean[] opts)
private void raw(int len,
long val)
private void rawh(int len,
long val)
private void raw_commit()
private void write_raw_file_header()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||