Botan 3.13.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 934 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 2189 of file x509_ext.cpp.

2189 {
2190 if(v.size() != Length) {
2191 throw Decoding_Error("number of bytes does not match IP version used");
2192 }
2193
2194 for(size_t i = 0; i < Length; i++) {
2195 m_value[i] = v[i];
2196 }
2197}

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 940 of file x509_ext.h.

940{ return m_value; }

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

◆ IPAddressBlocks

template<Version V>
friend class IPAddressBlocks
friend

Definition at line 943 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 957 of file x509_ext.h.

957 {
958 // we only really need to be able to compute +1, so this is fine
959 for(size_t i = 0; i < rhs; i++) {
960 lhs.next();
961 }
962 return IPAddress<V>(lhs);
963 }

References IPAddress().

◆ operator<=>

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

Definition at line 965 of file x509_ext.h.

965 =>(const IPAddress<V> lhs, const IPAddress<V>& rhs) {
966 for(size_t i = 0; i < Length; i++) {
967 if(lhs.value()[i] < rhs.value()[i]) {
969 } else if(lhs.value()[i] > rhs.value()[i]) {
971 }
972 }
974 }
std::array< uint8_t, Length > value() const
Definition x509_ext.h:940

References IPAddress(), and value().

◆ operator==

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

Definition at line 976 of file x509_ext.h.

976 {
977 return lhs.value() == rhs.value();
978 }

References IPAddress(), and value().


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