ost::IPV4Cidr(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– ost::IPV4Cidr β€” Library Functions Manual πŸ’–

okay so bestie, we're in the Library Functions Manual today and the main character is ost::IPV4Cidr. grab a boba, this one's actually cute. ✨


🌸 NAME 🌸

ost::IPV4Cidr β€” literally the CIDR class, bestie. she's the one holding down routing tables and validating address policies. no cap. πŸ’…


✨ SYNOPSIS ✨

#include <address.h>

🫢 Public Member Functions 🫢

  • struct in_addr getNetwork (void) const β€” grab the network address that belongs to this cidr.
  • struct in_addr getNetmask (void) const β€” grab the network mask that belongs to this cidr.
  • struct in_addr getBroadcast (void) const β€” compute the broadcast address that goes with this cidr.
  • void set (const char *cidr) β€” set the cidr, and you can feed her a full or partial hostname, or an address/mask, or a host/bits specification. she's flexible like that. πŸ’β€β™€οΈ
  • IPV4Cidr (const char *cidr) β€” build a brand new cidr out of a string.
  • IPV4Cidr () β€” build an empty cidr. a blank canvas, an empty group chat, a fresh start πŸ¦‹
  • IPV4Cidr (IPV4Cidr &) β€” build a copy of a cidr. twin energy πŸ‘―
  • bool isMember (const struct sockaddr *saddr) const β€” check whether a socket address is a member of this cidr's network.
  • bool isMember (const struct in_addr &inaddr) const β€” check whether a low level address object is a member of this cidr's net.
  • bool operator== (const struct sockaddr *a) const
  • bool operator== (const struct in_addr &a) const

πŸŽ€ Protected Member Functions πŸŽ€

  • unsigned getMask (const char *cp) const

πŸ’œ Protected Attributes πŸ’œ

  • struct in_addr netmask network

🌈 Detailed Description 🌈

The CIDR class is used to support routing tables and validate address policies. that's it, that's the whole vibe. she routes, she validates, she serves. πŸ‘‘

πŸ’« Author πŸ’«

David Sugar dyfet@gnutelephony.org

Classless Internet Domain Routing β€” yes bestie, that's what CIDR stands for, iykyk 🧚


🌷 Constructor & Destructor Documentation 🌷

ost::IPV4Cidr::IPV4Cidr (const char * cidr)

Construct a new cidr from a string. ✨

Parameters

  • cidr β€” string to use.

ost::IPV4Cidr::IPV4Cidr ()

Construct an empty cidr. so minimalist, so serene 🎐

ost::IPV4Cidr::IPV4Cidr (IPV4Cidr &)

Construct a copy of a cidr. πŸ’ž

Parameters

  • cidr β€” to copy from.

πŸ”₯ Member Function Documentation πŸ”₯

struct in_addr ost::IPV4Cidr::getBroadcast (void) const

Compute the broadcast address associated with this cidr.

Returns

  • system binary coded network address.

unsigned ost::IPV4Cidr::getMask (const char * cp) const [protected]

(this one's protected, so she's a little shy πŸ™ˆ β€” no extra details given, don't come for me)

struct in_addr ost::IPV4Cidr::getNetmask (void) const [inline]

Get network mask associated with this cidr.

Returns

  • system binary coded network mask.

struct in_addr ost::IPV4Cidr::getNetwork (void) const [inline]

Get network address associated with this cidr.

Returns

  • system binary coded address.

bool ost::IPV4Cidr::isMember (const struct in_addr & inaddr) const

See if a low level address object is a member of this cidr's net.

Parameters

  • inaddr β€” object to test.

Returns

  • true if member of cidr.

bool ost::IPV4Cidr::isMember (const struct sockaddr * saddr) const

See if a socket address is a member of this cidr's network.

Parameters

  • saddr β€” pointer to test.

Returns

  • true if member of cidr.

bool ost::IPV4Cidr::operator== (const struct in_addr & a) const [inline]

bool ost::IPV4Cidr::operator== (const struct sockaddr * a) const [inline]

void ost::IPV4Cidr::set (const char * cidr)

Set the cidr from a full or partial hostname, or from an address/mask, or a host/bits specification.

Parameters

  • cidr β€” string to use.

πŸ“ Member Data Documentation πŸ“

struct in_addr netmask ost::IPV4Cidr::network [protected]

protected attribute, bestie. hands off unless you're in the family πŸ’…


πŸ’Œ Author πŸ’Œ

Generated automatically by Doxygen for GNU CommonC++ from the source code. so it's not me writing this part, it's the robot, and honestly? the robot ate. πŸ€–βœ¨


mwah, that's the whole page bestie β€” go route some tables, validate some policies, be the main character of your network πŸ’–

this was GNU CommonC++, dated Sun Dec 27 2020, and it lives at ost::IPV4Cidr(3) πŸŽ€ bye pookie! 🫢

πŸ“¦ where this page comes from