Skip to content

Commit

Permalink
Fix broken links in doc (use intra-doc links)
Browse files Browse the repository at this point in the history
  • Loading branch information
chifflier committed Apr 24, 2024
1 parent 0ef4d90 commit ab3605b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//!
Expand Down Expand Up @@ -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
Expand All @@ -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
//!
Expand Down
2 changes: 1 addition & 1 deletion src/linktype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/pcap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
//! See <https://wiki.wireshark.org/Development/LibpcapFileFormat> 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;
Expand Down
2 changes: 1 addition & 1 deletion src/pcap/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down
14 changes: 7 additions & 7 deletions src/pcapng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
//! See <https://github.com/pcapng/pcapng> 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
//!
Expand Down
2 changes: 1 addition & 1 deletion src/pcapng/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down

0 comments on commit ab3605b

Please sign in to comment.