Botan 3.9.0
Crypto and TLS for C&
Botan::Cert_Extension::IPAddressBlocks::IPAddress< V > Class Template Referencefinal

#include <x509_ext.h>

Public Member Functions

 IPAddress (std::span< const uint8_t > v)
std::array< uint8_t, Length > value () const

Friends

class IPAddressBlocks
IPAddress< V > operator+ (IPAddress< V > lhs, size_t rhs)
std::strong_ordering operator<=> (const IPAddress< V > lhs, const IPAddress< V > &rhs)
bool operator== (const IPAddress< V > &lhs, const IPAddress< V > &rhs)

Detailed Description

template<Version V>
class Botan::Cert_Extension::IPAddressBlocks::IPAddress< V >

Definition at line 594 of file x509_ext.h.

Constructor & Destructor Documentation

◆ IPAddress()

template<Version V>
Botan::Cert_Extension::IPAddressBlocks::IPAddress< V >::IPAddress ( std::span< const uint8_t > v)
explicit

Definition at line 1380 of file x509_ext.cpp.

1380 {
1381 if(v.size() != Length) {
1382 throw Decoding_Error("number of bytes does not match IP version used");
1383 }
1384
1385 for(size_t i = 0; i < Length; i++) {
1386 m_value[i] = v[i];
1387 }
1388}

Referenced by IPAddressBlocks, operator+, operator<=>, and operator==.

Member Function Documentation

◆ value()

template<Version V>
std::array< uint8_t, Length > Botan::Cert_Extension::IPAddressBlocks::IPAddress< V >::value ( ) const
inline

Definition at line 600 of file x509_ext.h.

600{ return m_value; }

Referenced by operator<=>, and operator==.

◆ IPAddressBlocks

template<Version V>
friend class IPAddressBlocks
friend

Definition at line 603 of file x509_ext.h.

References IPAddress(), and IPAddressBlocks.

Referenced by IPAddressBlocks.

◆ operator+

template<Version V>
IPAddress< V > operator+ ( IPAddress< V > lhs,
size_t rhs )
friend

Definition at line 617 of file x509_ext.h.

617 {
618 // we only really need to be able to compute +1, so this is fine
619 for(size_t i = 0; i < rhs; i++) {
620 lhs.next();
621 }
622 return IPAddress<V>(lhs);
623 }

References IPAddress().

◆ operator<=>

template<Version V>
std::strong_ordering operator<=> ( const IPAddress< V > lhs,
const IPAddress< V > & rhs )
friend

Definition at line 625 of file x509_ext.h.

625 {
626 for(size_t i = 0; i < Length; i++) {
627 if(lhs.value()[i] < rhs.value()[i]) {
629 } else if(lhs.value()[i] > rhs.value()[i]) {
631 }
632 }
634 }
std::array< uint8_t, Length > value() const
Definition x509_ext.h:600

References IPAddress(), and value().

◆ operator==

template<Version V>
bool operator== ( const IPAddress< V > & lhs,
const IPAddress< V > & rhs )
friend

Definition at line 636 of file x509_ext.h.

636 {
637 return lhs.value() == rhs.value();
638 }

References IPAddress(), and value().


The documentation for this class was generated from the following files: