Skip to content

Commit 1fcf3eb

Browse files
polishing apidocs
1 parent 26225ab commit 1fcf3eb

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

cidre/src/commonMain/kotlin/at/asitplus/cidre/IpAddressAndPrefix.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ sealed interface IpAddressAndPrefix<N : Number, S : CidrNumber<S>> {
4747

4848
/**
4949
* Encodes this network into X.509 iPAddressName ByteArray (RFC 5280).
50-
* IPv4: [4 bytes base address][4 bytes subnet mask] (8 bytes)
51-
* IPv6: [16 bytes base address][16 bytes subnet mask] (32 bytes)
50+
* IPv4 byte layout: `AAAANNNN`, where `A` is an address octet and `N` is a netmask octet (8 bytes total)
51+
* IPv6 byte layout: `AAAAAAAAAAAAAAAANNNNNNNNNNNNNNNN`, where `A` is an address octet and `N` is a netmask octet(32 bytes total)
5252
*/
5353
fun toX509Octets(): ByteArray = address.octets + netmask
5454

@@ -57,8 +57,8 @@ sealed interface IpAddressAndPrefix<N : Number, S : CidrNumber<S>> {
5757
/**
5858
* Low-level helper used by [IpNetwork.fromX509Octets] and [IpInterface.fromX509Octets]
5959
* to extract base address and CIDR prefix
60-
* IPv4: [4 bytes base address][4 bytes subnet mask] (8 bytes)
61-
* IPv6: [16 bytes base address][16 bytes subnet mask] (32 bytes)
60+
* IPv4 byte layout: `AAAANNNN`, where `A` is an address octet and `N` is a netmask octet (8 bytes total)
61+
* IPv6 byte layout: `AAAAAAAAAAAAAAAANNNNNNNNNNNNNNNN`, where `A` is an address octet and `N` is a netmask octet(32 bytes total)
6262
*/
6363
internal fun parseX509Octets(bytes: ByteArray): Pair<IpAddress<*, *>, Prefix> =
6464
when (bytes.size) {

cidre/src/commonMain/kotlin/at/asitplus/cidre/IpInterface.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ constructor(override val prefix: Prefix, val network: IpNetwork<N, S>) :
4545

4646
/**
4747
* Decodes an IpInterface from X.509 iPAddressName ByteArray (RFC 5280).
48-
* IPv4: [4 bytes base address][4 bytes subnet mask] (8 bytes)
49-
* IPv6: [16 bytes base address][16 bytes subnet mask] (32 bytes)
48+
* IPv4 byte layout: `AAAANNNN`, where `A` is an address octet and `N` is a netmask octet (8 bytes total)
49+
* IPv6 byte layout: `AAAAAAAAAAAAAAAANNNNNNNNNNNNNNNN`, where `A` is an address octet and `N` is a netmask octet(32 bytes total)
5050
*/
5151
@Throws(IllegalArgumentException::class)
5252
fun fromX509Octets(bytes: ByteArray): IpInterface<*, *> {

cidre/src/commonMain/kotlin/at/asitplus/cidre/IpNetwork.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,8 @@ constructor(address: IpAddress<N, S>, override val prefix: Prefix, strict: Boole
531531

532532
/**
533533
* Decodes an IpNetwork from X.509 iPAddressName ByteArray (RFC 5280).
534-
* IPv4: [4 bytes base address][4 bytes subnet mask] (8 bytes)
535-
* IPv6: [16 bytes base address][16 bytes subnet mask] (32 bytes)
534+
* IPv4 byte layout: `AAAANNNN`, where `A` is an address octet and `N` is a netmask octet (8 bytes total)
535+
* IPv6 byte layout: `AAAAAAAAAAAAAAAANNNNNNNNNNNNNNNN`, where `A` is an address octet and `N` is a netmask octet(32 bytes total)
536536
*/
537537
fun fromX509Octets(bytes: ByteArray): IpNetwork<*, *> {
538538
val (addr, prefix) = parseX509Octets(bytes)

local.properties

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
sdk.dir=/Users/bpruenster/Library/Android/sdk
1+
## This file must *NOT* be checked into Version Control Systems,
2+
# as it contains information specific to your local configuration.
3+
#
4+
# Location of the SDK. This is only used by Gradle.
5+
# For customization when using a Version Control System, please read the
6+
# header note.
7+
#Tue Sep 23 11:14:58 CEST 2025
8+
sdk.dir=C\:\\Users\\srdjan.stjepanovic\\AppData\\Local\\Android\\Sdk

0 commit comments

Comments
 (0)