MySQL 8.3.0
Source Code Documentation
ACL_HOST_AND_IP Class Reference

#include <sql_auth_cache.h>

Public Types

enum  enum_ip_mask_type { ip_mask_type_implicit , ip_mask_type_cidr , ip_mask_type_subnet }
 IP mask type enum. More...
 

Public Member Functions

 ACL_HOST_AND_IP ()
 
const char * get_host () const
 
size_t get_host_len () const
 
bool has_wildcard ()
 
bool check_allow_all_hosts ()
 
void update_hostname (const char *host_arg)
 Update the hostname. More...
 
bool compare_hostname (const char *host_arg, const char *ip_arg)
 

Static Public Member Functions

static bool calc_cidr_mask (const char *ip_arg, long *val)
 IP mask parsing in the CIDR format. More...
 
static bool calc_ip_mask (const char *ip_arg, long *val)
 IP mask parsing in the subnet format. More...
 
static const char * calc_ip (const char *ip_arg, long *val)
 IP parsing. More...
 

Public Attributes

const char * hostname
 
size_t hostname_length
 
long ip
 
long ip_mask
 
enum_ip_mask_type ip_mask_type
 IP mask type. More...
 

Member Enumeration Documentation

◆ enum_ip_mask_type

IP mask type enum.

Enumerator
ip_mask_type_implicit 

Only IP is specified.

ip_mask_type_cidr 

IP specified with a mask in a CIDR form.

ip_mask_type_subnet 

IP specified with a mask in a form of a subnet.

Constructor & Destructor Documentation

◆ ACL_HOST_AND_IP()

ACL_HOST_AND_IP::ACL_HOST_AND_IP ( )
inline

Member Function Documentation

◆ calc_cidr_mask()

bool ACL_HOST_AND_IP::calc_cidr_mask ( const char *  ip_arg,
long *  val 
)
static

IP mask parsing in the CIDR format.

Parameters
[in]ip_argBuffer containing CIDR mask value.
[out]valNumeric IP mask value on success.
Return values
falseParsing succeeded.
trueParsing failed.

◆ calc_ip()

const char * ACL_HOST_AND_IP::calc_ip ( const char *  ip_arg,
long *  val 
)
static

IP parsing.

Parameters
[in]ip_argBuffer containing IP value.
[out]valNumeric IP value on success.
Return values
!nullptrParsing succeeded. Returned value is the pointer following the buffer holding the IP.
nullptrParsing failed. The buffer does not contain valid IP value.

◆ calc_ip_mask()

bool ACL_HOST_AND_IP::calc_ip_mask ( const char *  ip_arg,
long *  val 
)
static

IP mask parsing in the subnet format.

Parameters
[in]ip_argBuffer containing subnet mask value.
[out]valNumeric IP mask value on success.
Return values
falseParsing succeeded.
trueParsing failed.

◆ check_allow_all_hosts()

bool ACL_HOST_AND_IP::check_allow_all_hosts ( )
inline

◆ compare_hostname()

bool ACL_HOST_AND_IP::compare_hostname ( const char *  host_arg,
const char *  ip_arg 
)

◆ get_host()

const char * ACL_HOST_AND_IP::get_host ( ) const
inline

◆ get_host_len()

size_t ACL_HOST_AND_IP::get_host_len ( ) const
inline

◆ has_wildcard()

bool ACL_HOST_AND_IP::has_wildcard ( )
inline

◆ update_hostname()

void ACL_HOST_AND_IP::update_hostname ( const char *  host_arg)

Update the hostname.

Updates ip and ip_mask accordingly.

Parameters
host_argValue to be stored

Member Data Documentation

◆ hostname

const char* ACL_HOST_AND_IP::hostname

◆ hostname_length

size_t ACL_HOST_AND_IP::hostname_length

◆ ip

long ACL_HOST_AND_IP::ip

◆ ip_mask

long ACL_HOST_AND_IP::ip_mask

◆ ip_mask_type

enum_ip_mask_type ACL_HOST_AND_IP::ip_mask_type

IP mask type.


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