diff --git a/README.md b/README.md index d4a390d..6426e79 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ section, in order of appearance.* ## Example: streaming parsers The following code shows how to parse a file in the pcap-ng format, using a -[`PcapNGReader`](https://docs.rs/pcap-parser/latest/pcap_parser/struct.PcapNGReader.html) streaming parser. +[`PcapNGReader`] streaming parser. This reader provides a convenient abstraction over the file format, and takes care of the endianness. @@ -86,13 +86,13 @@ loop { } println!("num_blocks: {}", num_blocks); ``` -See [`PcapNGReader`](https://docs.rs/pcap-parser/latest/pcap_parser/struct.PcapNGReader.html) for a complete example, +See [`PcapNGReader`] for a complete example, including handling of linktype and accessing packet data. -See also the [`pcapng`](https://docs.rs/pcap-parser/latest/pcap_parser/pcapng/index.html) module for more details about the new capture file format. +See also the [`pcapng`] module for more details about the new capture file format. For legacy pcap files, use similar code with the -[`LegacyPcapReader`](https://docs.rs/pcap-parser/latest/pcap_parser/struct.LegacyPcapReader.html) streaming parser. +[`LegacyPcapReader`] streaming parser. See [pcap-analyzer](https://github.com/rusticata/pcap-analyzer), in particular the [libpcap-tools](https://github.com/rusticata/pcap-analyzer/tree/master/libpcap-tools) and @@ -102,7 +102,7 @@ for more examples. ## Example: generic streaming parsing To create a pcap reader for input in either PCAP or PCAPNG format, use the -[`create_reader`](https://docs.rs/pcap-parser/latest/pcap_parser/fn.create_reader.html) function. +[`create_reader`] function. # Serialization diff --git a/src/lib.rs b/src/lib.rs index 4bbf4a0..b49c2a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,7 +56,7 @@ //! ## Example: streaming parsers //! //! The following code shows how to parse a file in the pcap-ng format, using a -//! [`PcapNGReader`](struct.PcapNGReader.html) streaming parser. +//! [`PcapNGReader`] streaming parser. //! This reader provides a convenient abstraction over the file format, and takes //! care of the endianness. //! @@ -85,13 +85,13 @@ //! } //! println!("num_blocks: {}", num_blocks); //! ``` -//! See [`PcapNGReader`](struct.PcapNGReader.html) for a complete example, +//! See [`PcapNGReader`] for a complete example, //! including handling of linktype and accessing packet data. //! -//! See also the [`pcapng`](pcapng/index.html) module for more details about the new capture file format. +//! See also the [`pcapng`] module for more details about the new capture file format. //! //! For legacy pcap files, use similar code with the -//! [`LegacyPcapReader`](struct.LegacyPcapReader.html) streaming parser. +//! [`LegacyPcapReader`] streaming parser. //! //! See [pcap-analyzer](https://github.com/rusticata/pcap-analyzer), in particular the //! [libpcap-tools](https://github.com/rusticata/pcap-analyzer/tree/master/libpcap-tools) and @@ -101,7 +101,7 @@ //! ## Example: generic streaming parsing //! //! To create a pcap reader for input in either PCAP or PCAPNG format, use the -//! [`create_reader`](fn.create_reader.html) function. +//! [`create_reader`] function. //! //! # Serialization //! diff --git a/src/linktype.rs b/src/linktype.rs index b1cf6bd..0830f5f 100644 --- a/src/linktype.rs +++ b/src/linktype.rs @@ -28,7 +28,7 @@ impl display Linktype { IPV6 = 229, // Linux netlink NETLINK NFLOG socket log messages. - // Use the [`pcap_nflog`]()../pcap_nflog/index.html module to access content. + // Use the [`pcap_nflog`] module to access content. NFLOG = 239, // Upper-layer protocol saves from Wireshark diff --git a/src/pcap.rs b/src/pcap.rs index 9bb22e1..f90139b 100644 --- a/src/pcap.rs +++ b/src/pcap.rs @@ -3,16 +3,16 @@ //! See for details. //! //! There are 2 main ways of parsing a PCAP file. The first method is to use -//! [`parse_pcap`](../fn.parse_pcap.html). This method requires to load the entire +//! [`parse_pcap`]. This method requires to load the entire //! file to memory, and thus may not be good for large files. //! -//! The [`PcapCapture`](../struct.PcapCapture.html) implements the -//! [`Capture`](../trait.Capture.html) trait to provide generic methods. However, +//! The [`PcapCapture`] implements the +//! [`Capture`](crate::Capture) trait to provide generic methods. However, //! this trait also reads the entire file. //! //! The second method is to first parse the PCAP header -//! using [`parse_pcap_header`](fn.parse_pcap_header.html), then -//! loop over [`parse_pcap_frame`](fn.parse_pcap_frame.html) to get the data. +//! using [`parse_pcap_header`], then +//! loop over [`parse_pcap_frame`] to get the data. //! This can be used in a streaming parser. mod capture; diff --git a/src/pcap/reader.rs b/src/pcap/reader.rs index 4c1b47d..02997a3 100644 --- a/src/pcap/reader.rs +++ b/src/pcap/reader.rs @@ -26,7 +26,7 @@ use std::io::Read; /// larger value (at least 65k) is advised to avoid frequent reads and buffer shifts. /// /// **There are precautions to take when reading multiple blocks before consuming data. See -/// [PcapReaderIterator](traits/trait.PcapReaderIterator.html) for details.** +/// [`PcapReaderIterator`] for details.** /// /// ## Example /// diff --git a/src/pcapng.rs b/src/pcapng.rs index 0a03eec..baab41e 100644 --- a/src/pcapng.rs +++ b/src/pcapng.rs @@ -3,20 +3,20 @@ //! See for details. //! //! There are several ways of parsing a PCAPNG file. The first method is to use -//! [`parse_pcapng`](../fn.parse_pcapng.html). This method requires to load the entire +//! [`parse_pcapng`]. This method requires to load the entire //! file to memory, and thus may not be good for large files. //! -//! The second method is to create a [`PcapNGCapture`](../struct.PcapNGCapture.html) object, -//! which implements the [`Capture`](../trait.Capture.html) trait to provide generic methods. +//! The second method is to create a [`PcapNGCapture`] object, +//! which implements the [`Capture`](crate::Capture) trait to provide generic methods. //! However, this method also reads the entire file. //! -//! The third (and prefered) method is to use a [`PcapNGReader`](../struct.PcapNGReader.html) +//! The third (and prefered) method is to use a [`PcapNGReader`] //! object. //! //! The last method is to manually read the blocks using -//! [`parse_sectionheaderblock`](fn.parse_sectionheaderblock.html), -//! [`parse_block_le`](fn.parse_block_le.html) and/or -//! [`parse_block_be`](fn.parse_block_be.html). +//! [`parse_sectionheaderblock`], +//! [`parse_block_le`] and/or +//! [`parse_block_be`]. //! //! ## File format and parsing //! diff --git a/src/pcapng/reader.rs b/src/pcapng/reader.rs index 39cfad3..ff13a6a 100644 --- a/src/pcapng/reader.rs +++ b/src/pcapng/reader.rs @@ -30,7 +30,7 @@ use std::io::Read; /// larger value (at least 65k) is advised to avoid frequent reads and buffer shifts. /// /// **There are precautions to take when reading multiple blocks before consuming data. See -/// [PcapReaderIterator](traits/trait.PcapReaderIterator.html) for details.** +/// [`PcapReaderIterator`] for details.** /// /// ## Example ///