Skip to content

Commit 26c5c97

Browse files
committed
fix some doc
1 parent 916ff31 commit 26c5c97

3 files changed

Lines changed: 31 additions & 31 deletions

File tree

doc/api_ref/ffi.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,9 +2117,9 @@ X.509 Certificates
21172117
size_t* v4_count, \
21182118
size_t* v6_count)
21192119

2120-
Get info about the IP Address Blocks extension from `RFC 3779 <https://www.rfc-editor.org/rfc/rfc3779>`.
2121-
`v4_count` is be set to the number of v4 families contained in the extension,
2122-
`v6_count` to the number of v6 families. If the extension is not present, `BOTAN_FFI_ERROR_NO_VALUE` is be returned.
2120+
Get info about the IP Address Blocks extension from `RFC 3779 <https://www.rfc-editor.org/rfc/rfc3779>`_.
2121+
``v4_count`` is set to the number of v4 families contained in the extension,
2122+
``v6_count`` to the number of v6 families. If the extension is not present, :cpp:enumerator:`BOTAN_FFI_ERROR_NO_VALUE` is returned.
21232123

21242124
.. cpp:function:: int botan_x509_ext_ip_addr_blocks_get_family(botan_x509_cert_t cert, \
21252125
size_t v4_count, \
@@ -2131,13 +2131,13 @@ X.509 Certificates
21312131
size_t* count)
21322132

21332133
Get info about a specific family in the extension.
2134-
`v4_count` is obtained from `botan_x509_ext_ip_addr_blocks_get_counts`, `ipv6` should be set to 0 for v4 families,
2135-
1 for v6 families. `i` is the local index for each family type, the first v4 family is at `i = 0`,
2136-
`ipv6 = 0`, the first v6 family is at `i = 0`, `ipv6 = 1`.
2137-
`has_safi` is be set to 1 if the family has an associated SAFI, else 0.
2138-
`safi` contains the SAFI if the family has one, otherwise its value is undefined.
2139-
`present` is set to 1 if the family has range values, 0 if it is marked as "inherit".
2140-
`count` is set to the number of ranges contained if any, otherwise its value is undefined.
2134+
``v4_count`` is obtained from :cpp:func:`botan_x509_ext_ip_addr_blocks_get_counts`, ``ipv6`` should be set to 0 for v4 families,
2135+
1 for v6 families. ``i`` is the local index for each family type, the first v4 family is at ``i = 0``,
2136+
``ipv6 = 0``, the first v6 family is at ``i = 0``, ``ipv6 = 1``.
2137+
``has_safi`` is set to 1 if the family has an associated SAFI, else 0.
2138+
``safi`` contains the SAFI if the family has one, otherwise its value is undefined.
2139+
``present`` is set to 1 if the family has range values, 0 if it is marked as "inherit".
2140+
``count`` is set to the number of ranges contained if any, otherwise its value is undefined.
21412141

21422142
.. cpp:function:: int botan_x509_ext_ip_addr_blocks_get_address(botan_x509_cert_t cert, \
21432143
size_t v4_count, \
@@ -2149,21 +2149,21 @@ X.509 Certificates
21492149
size_t* out_len)
21502150

21512151
Get info about a specific range in the extension.
2152-
`v4_count`, `ipv6` and `i` behave as in `botan_x509_ext_ip_addr_blocks_get_family`.
2153-
`entry` is the index to the range in the family, between 0 and (not including) `count`.
2154-
`min_out` and `max_out` are set to the min and max addresses of the range respectively.
2155-
`out_len` should be set to 4 for v4 families, 16 for v6 families, the two arrays must also be that size.
2152+
``v4_count``, ``ipv6`` and ``i`` behave as in `botan_x509_ext_ip_addr_blocks_get_family`.
2153+
``entry`` is the index to the range in the family, between 0 and (not including) ``count``.
2154+
``min_out`` and ``max_out`` are set to the min and max addresses of the range respectively.
2155+
``out_len`` should be set to 4 for v4 families, 16 for v6 families, the two arrays must also be that size.
21562156

21572157
.. cpp:function:: int botan_x509_ext_as_blocks_get_info(botan_x509_cert_t cert, \
21582158
int asnum, \
21592159
int* present, \
21602160
size_t* count)
21612161

2162-
Get info about the AS Blocks extension from `RFC 3779 <https://www.rfc-editor.org/rfc/rfc3779>`.
2163-
`asnum` should be set to 1 to get info about the ASNUM part of the extension, 0 for RDI.
2164-
`present` is set to 1 if a value is contained, 0 if that part of the extension is marked as "inherit".
2165-
If the part is not present at all, `BOTAN_FFI_ERROR_NO_VALUE` will be returned.
2166-
`count` is set to the number of entries for that part if any, otherwise its value is undefined.
2162+
Get info about the AS Blocks extension from `RFC 3779 <https://www.rfc-editor.org/rfc/rfc3779>`_.
2163+
``asnum`` should be set to 1 to get info about the ASNUM part of the extension, 0 for RDI.
2164+
``present`` is set to 1 if a value is contained, 0 if that part of the extension is marked as "inherit".
2165+
If the part is not present at all, :cpp:enumerator:`BOTAN_FFI_ERROR_NO_VALUE` will be returned.
2166+
``count`` is set to the number of entries for that part if any, otherwise its value is undefined.
21672167

21682168

21692169
.. cpp:function:: int botan_x509_ext_as_blocks_get_entry_at(botan_x509_cert_t cert, \
@@ -2173,9 +2173,9 @@ X.509 Certificates
21732173
uint32_t* max)
21742174

21752175
Get info about a specific entry from the extension.
2176-
`asnum` behaves as in `botan_x509_ext_as_blocks_get_info`, `i` is the index for that part,
2177-
between 0 and (not including) `count`.
2178-
`min` and `max` will be set to the minimum and maximum AS numbers of the range respectively.
2176+
``asnum`` behaves as in :cpp:func:`botan_x509_ext_as_blocks_get_info`, ``i`` is the index for that part,
2177+
between 0 and (not including) ``count``.
2178+
``min`` and ``max`` will be set to the minimum and maximum AS numbers of the range respectively.
21792179

21802180
X.509 Certificate Revocation Lists
21812181
----------------------------------------

src/lib/ffi/ffi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2730,7 +2730,7 @@ int botan_x509_ext_ip_addr_blocks_get_family(botan_x509_cert_t cert,
27302730

27312731
/**
27322732
* Get info about a specific range in the extension
2733-
* @param v4_count must the set to the number of v4 families present
2733+
* @param v4_count must be set to the number of v4 families present
27342734
* @param ipv6 must be set to 1 if the family is an IPv6 family, 0 for IPv4 families
27352735
* @param i is the (local) index of the family, see `botan_x509_ext_ip_addr_blocks_get_family`
27362736
* @param entry is the index of the range

src/python/botan3.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,17 +2373,17 @@ def handle_(self):
23732373
return self.__obj
23742374

23752375
def ext_ip_addr_blocks(self) -> tuple[
2376-
list[tuple[int | None, list[tuple[list[int], list[int]]] | None]],
2377-
list[tuple[int | None, list[tuple[list[int], list[int]]] | None]]
2376+
list[tuple[int | None, list[tuple[tuple[int], tuple[int]]] | None]],
2377+
list[tuple[int | None, list[tuple[tuple[int], tuple[int]]] | None]]
23782378
]:
23792379
"""Get values from the IP Address Blocks extension.
23802380
If the extension is not present, an exception will be raised.
23812381
2382-
Returns all values in the extension, in the form of (v4, v6), where both contain a tuple of
2383-
type (int | None, list[...]). The first element of the tuple is the SAFI, it may be `None`
2382+
Returns all values in the extension, in the form of (v4, v6), where both contain a list of tuples of
2383+
type (int | None, list[...]). The first element of each tuple is the SAFI, it may be `None`
23842384
to indicate no SAFI is present. The second element is a list of elements of type
2385-
tuple[list[int], list[int]], where each element is a single address range. Each element contains
2386-
two lists of equal length, 4 for IPv4 families and 16 for IPv6 families. The values are the minimum
2385+
tuple[tuple[int], tuple[int]], where each element is a single address range. Each element contains
2386+
two tuples of equal length, 4 for IPv4 families and 16 for IPv6 families. The values are the minimum
23872387
and maximum addresses of the range respectively. If the particular family is marked as "inherit",
23882388
the outer tuple will contain `None` as its second element instead of a list of ranges."""
23892389
v4 = []
@@ -2397,8 +2397,8 @@ def ext_ip_addr_blocks(self) -> tuple[
23972397
v4_count = v4_count.value
23982398
v6_count = v6_count.value
23992399

2400-
for (ipv6, count) in ((0, v4_count), (1, v6_count)):
2401-
for i in range(count):
2400+
for (ipv6, stop) in ((0, v4_count), (1, v6_count)):
2401+
for i in range(stop):
24022402
size = 16 if ipv6 else 4
24032403

24042404
has_safi = c_int(0)

0 commit comments

Comments
 (0)