- Tutorials
- API Examples
- User Guide
- Ch 1 - The Basics
- Ch 2 - libpcap
- 2.1 - The Main libpcap API Overview
- 2.2 - Getting a List of Interfaces
- 2.3 - Opening a Network Interface for Capture
- 2.4 - Opening offline capture
- 2.5 - Setting a packet filter
- 2.6 - Reading one packet at a time
- 2.7 - Reading multiple packets with dispatch loops
- 2.8 - Dumping captured packet to an offline file
- 2.9 - Transmitting packets
- 2.10 - Close Pcap and PcapDumper handles
- Ch 3 - Packet Decoding
- Ch 4 - Internals
- Ch 5 - Protocols
- Ch 6 - Native API
The header definition file not only is a subclass of JHeader but must also use some annotations. Annotations are there to mark certain methods as being special and supply some static parameters. Here is a complete list of all annotations that can be used in header definition and support classes.
- @Header - marks a class as being a header, may specify nicname and static length of the header
- @HeaderLength - if header length is not static, a method can be specified that will calculate and return the length of the header at runtime
- @Field - marks a field. This annotation actually creates a field and a field value getter. It also allows several field properties to be specified statically.
- @Dynamic - marks a method as one providing some kind of field property dynamically at runtime. For example the field's description property can be returned from a method dynamically instead of being supplied statically.
- @FieldSetter - marks a method as one that changes the value of the field within the header.
- @Bind - protocol to protocol binding. The static method checks if source protocol is bound to a target protocol and returns a boolean flag.
- @Scanner - allows forward bindings to occur. The scanner method overrides the actual protocol scan method natively and allows a java counter part to replace it. Its more complex but much more powerful and efficient way to do protocol to protocol bindings and header length discovery, all in one step.
»
Printer-friendly- Login or register to post comments
Send via Email
PDF Convert