You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/autogen.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,12 @@ To minimize the amount of C++ code that must be written in order to handle assig
7
7
The goals of the auto-generation system are:
8
8
9
9
* to minimize the amount of tedious and error-prone manual work involved in implementing protocols,
10
-
10
+
11
11
* to provide a uniform programmatic interface and JSON output syntax for different assigned numbers, and
12
-
12
+
13
13
* to have tooling that can be re-run in the future so that new assigned number values can be easily brought into the software
14
14
once they are registered with IANA,
15
-
15
+
16
16
* to track assigned numbers that are not registered with IANA, and be able to combine this information with IANA data.
17
17
18
18
We used the following approach. Each assigned number is represented by a single C++ class, which is generated from one or more CSV files, using the `csv` utility. A Makefile controls the downloading of CSV files from IANA files, and the running of `csv`, to create a single C++ header-only library that includes all of the assigned number classes for a particular protocol. The `wget` utility is used for downloading files. The resulting protocol library header file is written into the `src/tables/` subdirectory; it must be manually copied into the `src/libmerc` subdirectory to be used in mercury. Any protocol library used in mercury must be copied into that directory and committed into the mercury git repo, so that it doesn’t need to be auto-generated for each build.
@@ -63,7 +63,7 @@ Value,Name,Reference
63
63
0x03-0xff,Unassigned,
64
64
```
65
65
66
-
As with the IANA conventions, the cells in the first line describes the data in their columns. The last cell in the other lines are empty, which is acceptable, although each line must have the same number of cells.
66
+
As with the IANA conventions, the cells in the first line describes the data in their columns. The last cell in the other lines are empty, which is acceptable, although each line must have the same number of cells.
67
67
68
68
Let's run `csv` on that file, from the `src/tables` directory, and write the output into `example.h`:
69
69
@@ -133,11 +133,11 @@ As implemented, the `csv` utility provides minimal error reporting. Users deser
133
133
134
134
When working with additional protocols, it may be necessary to tweak the code to handle slightly different CSV file conventions.
135
135
136
-
One important limitation of the current system is that ranges (such as 0x03-0xff) are not handled. A future version could add provide the information about what range a number is in through the `get_name()`member function, or a new member function.
136
+
One important limitation of the current system is that ranges (such as 0x03-0xff) are not handled. A future version could add provide the information about what range a number is in through the `get_name()`member function, or a new member function.
137
137
138
-
Additional information about a number could be provided through additional member functions. The RFC numbers associated with most IANA registrations could be used to determine the year that a protocol option was standardized, and this information could be provided through a member function. The range of years associated with the assigned numbers in a protocol message give a strong indication of the year that the implementation was completed. Another useful bit of information is the RFC reference itself, which could be provided as a URL to facilitate quick lookups.
138
+
Additional information about a number could be provided through additional member functions. The RFC numbers associated with most IANA registrations could be used to determine the year that a protocol option was standardized, and this information could be provided through a member function. The range of years associated with the assigned numbers in a protocol message give a strong indication of the year that the implementation was completed. Another useful bit of information is the RFC reference itself, which could be provided as a URL to facilitate quick lookups.
139
139
140
-
There are well-known addresses that are managed by IANA, which could be handled as assigned numbers.
140
+
There are well-known addresses that are managed by IANA, which could be handled as assigned numbers.
141
141
142
142
Well-known ports could also be handled as assigned numbers, though implementations often use nonstandard destination ports, and IANA registrations should be taken with a grain of salt.
Copy file name to clipboardExpand all lines: doc/fdc.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,16 @@
2
2
3
3
4
4
5
-
This note documents the data formats used in the Mercury Fingerprint and Destination Context (FDC). The FDC is encoded using the Concise Binary Object Representation ([CBOR](https://datatracker.ietf.org/doc/html/rfc8949)), an IETF standard data format that is extensible, consice, and trivially mappable to the common JavaScript Object Notation ([JSON](https://datatracker.ietf.org/doc/html/rfc8259)). The formats are formally defined using the Concise Data Definition Language ([CDDL](https://datatracker.ietf.org/doc/html/rfc8610)), an IETF standard notational convention for unamiguously expressing CBOR and JSON data formats.
5
+
This note documents the data formats used in the Mercury Fingerprint and Destination Context (FDC). The FDC is encoded using the Concise Binary Object Representation ([CBOR](https://datatracker.ietf.org/doc/html/rfc8949)), an IETF standard data format that is extensible, consice, and trivially mappable to the common JavaScript Object Notation ([JSON](https://datatracker.ietf.org/doc/html/rfc8259)). The formats are formally defined using the Concise Data Definition Language ([CDDL](https://datatracker.ietf.org/doc/html/rfc8610)), an IETF standard notational convention for unamiguously expressing CBOR and JSON data formats.
6
6
7
7
A Fingerprint and Destination Context (FDC) object contains a Network Protocol Fingerprint ([NPF](https://github.com/cisco/mercury/blob/main/doc/npf.md)) and other data features, all of which are metadata observed in a single network session. An NPF fingerprint is a set of data features formed by selecting and normalizing some elements of a protocol message, so that they are correlated with the sending application or library implementation. A fingerprint by itself sometimes uniquely identifies an application, but often does not. In the latter case, the other data features are valuable for indentifying the sending application.
8
8
9
-
- An NPF fingerprint in CBOR encoding, as defined in the [NPF CDDL specification](https://github.com/cisco/mercury/blob/main/doc/npf.cddl).
9
+
- An NPF fingerprint in CBOR encoding, as defined in the [NPF CDDL specification](https://github.com/cisco/mercury/blob/main/doc/npf.cddl).
10
10
- The server name, which corresponds to the TLS or QUIC Server Name field or the HTTP Host field.
11
11
- The destination IP address, as a string containing a textual representation.
12
12
- The destination port number, as an unsigned integer less than 64,535.
13
13
- The user agent as a string, which corresponds to the value of the User-Agent header for HTTP, the value of the SOFTWARE attribute for STUN, and the concatenation of the Protocol and Comment strings for SSH.
14
-
- Optionally, an unsigned integer corresponding to the truncation code, which indicates whether reassembly was required in order to obtain a complete fingerprint, and whether or not the fingerprint was truncated due to a missing packet. Its values are
14
+
- Optionally, an unsigned integer corresponding to the truncation code, which indicates whether reassembly was required in order to obtain a complete fingerprint, and whether or not the fingerprint was truncated due to a missing packet. Its values are
@@ -52,14 +52,13 @@ The test program [test_intercept.sh](../test/test_intercept.sh) shows how the li
52
52
53
53
Function interception is currently implemented for these libraries (listed with their Debian/Ubuntu package names):
54
54
55
-
* openssl (libssl-dev)
56
-
* NSS (libnss3-dev)
57
-
* GNUtls (libgnutls28-dev)
58
-
55
+
* openssl (libssl-dev)
56
+
* NSS (libnss3-dev)
57
+
* GNUtls (libgnutls28-dev)
58
+
59
59
60
60
61
61
62
62
## Disclaimer
63
63
64
64
The interceptor library is experimental, and will continue to evolve. Please do not use it in mission-critical environments. Feedback is welcome; please send to [[email protected].]([email protected]).
0 commit comments