Asterisk - The Open Source Telephony Project  18.5.0
Functions
dns_naptr.h File Reference

DNS NAPTR Record Parsing API. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const char * ast_dns_naptr_get_flags (const struct ast_dns_record *record)
 Get the flags from a NAPTR record. More...
 
unsigned short ast_dns_naptr_get_order (const struct ast_dns_record *record)
 Get the order from a NAPTR record. More...
 
unsigned short ast_dns_naptr_get_preference (const struct ast_dns_record *record)
 Get the preference from a NAPTR record. More...
 
const char * ast_dns_naptr_get_regexp (const struct ast_dns_record *record)
 Get the regular expression from a NAPTR record. More...
 
const char * ast_dns_naptr_get_replacement (const struct ast_dns_record *record)
 Get the replacement value from a NAPTR record. More...
 
const char * ast_dns_naptr_get_service (const struct ast_dns_record *record)
 Get the service from a NAPTR record. More...
 

Detailed Description

DNS NAPTR Record Parsing API.

Author
Joshua Colp jcolp.nosp@m.@dig.nosp@m.ium.c.nosp@m.om

Definition in file dns_naptr.h.

Function Documentation

◆ ast_dns_naptr_get_flags()

const char* ast_dns_naptr_get_flags ( const struct ast_dns_record record)

Get the flags from a NAPTR record.

Parameters
recordThe DNS record
Returns
the flags

Definition at line 600 of file dns_naptr.c.

References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_naptr_record::flags.

Referenced by AST_TEST_DEFINE(), and sip_resolve_handle_naptr().

601 {
602  struct ast_dns_naptr_record *naptr = (struct ast_dns_naptr_record *) record;
603 
604  ast_assert(ast_dns_record_get_rr_type(record) == T_NAPTR);
605  return naptr->flags;
606 }
const char * flags
The flags from the NAPTR record.
Definition: dns_internal.h:96
#define ast_assert(a)
Definition: utils.h:695
Definition: enum.h:28
A NAPTR record.
Definition: dns_internal.h:92
int ast_dns_record_get_rr_type(const struct ast_dns_record *record)
Get the resource record type of a DNS record.
Definition: dns_core.c:145

◆ ast_dns_naptr_get_order()

unsigned short ast_dns_naptr_get_order ( const struct ast_dns_record record)

Get the order from a NAPTR record.

Parameters
recordThe DNS record
Returns
the order

Definition at line 632 of file dns_naptr.c.

References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_naptr_record::order.

Referenced by AST_TEST_DEFINE(), and sip_resolve_callback().

633 {
634  struct ast_dns_naptr_record *naptr = (struct ast_dns_naptr_record *) record;
635 
636  ast_assert(ast_dns_record_get_rr_type(record) == T_NAPTR);
637  return naptr->order;
638 }
#define ast_assert(a)
Definition: utils.h:695
Definition: enum.h:28
A NAPTR record.
Definition: dns_internal.h:92
int ast_dns_record_get_rr_type(const struct ast_dns_record *record)
Get the resource record type of a DNS record.
Definition: dns_core.c:145
unsigned short order
The order for the NAPTR record.
Definition: dns_internal.h:104

◆ ast_dns_naptr_get_preference()

unsigned short ast_dns_naptr_get_preference ( const struct ast_dns_record record)

Get the preference from a NAPTR record.

Parameters
recordThe DNS record
Returns
the preference

Definition at line 640 of file dns_naptr.c.

References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_naptr_record::preference.

Referenced by AST_TEST_DEFINE().

641 {
642  struct ast_dns_naptr_record *naptr = (struct ast_dns_naptr_record *) record;
643 
644  ast_assert(ast_dns_record_get_rr_type(record) == T_NAPTR);
645  return naptr->preference;
646 }
#define ast_assert(a)
Definition: utils.h:695
unsigned short preference
The preference of the NAPTR record.
Definition: dns_internal.h:106
Definition: enum.h:28
A NAPTR record.
Definition: dns_internal.h:92
int ast_dns_record_get_rr_type(const struct ast_dns_record *record)
Get the resource record type of a DNS record.
Definition: dns_core.c:145

◆ ast_dns_naptr_get_regexp()

const char* ast_dns_naptr_get_regexp ( const struct ast_dns_record record)

Get the regular expression from a NAPTR record.

Parameters
recordThe DNS record
Returns
the regular expression

Definition at line 616 of file dns_naptr.c.

References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_naptr_record::regexp.

Referenced by AST_TEST_DEFINE().

617 {
618  struct ast_dns_naptr_record *naptr = (struct ast_dns_naptr_record *) record;
619 
620  ast_assert(ast_dns_record_get_rr_type(record) == T_NAPTR);
621  return naptr->regexp;
622 }
#define ast_assert(a)
Definition: utils.h:695
const char * regexp
The regular expression from the NAPTR record.
Definition: dns_internal.h:100
Definition: enum.h:28
A NAPTR record.
Definition: dns_internal.h:92
int ast_dns_record_get_rr_type(const struct ast_dns_record *record)
Get the resource record type of a DNS record.
Definition: dns_core.c:145

◆ ast_dns_naptr_get_replacement()

const char* ast_dns_naptr_get_replacement ( const struct ast_dns_record record)

Get the replacement value from a NAPTR record.

Parameters
recordThe DNS record
Returns
the replacement value

Definition at line 624 of file dns_naptr.c.

References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_naptr_record::replacement.

Referenced by AST_TEST_DEFINE(), and sip_resolve_handle_naptr().

625 {
626  struct ast_dns_naptr_record *naptr = (struct ast_dns_naptr_record *) record;
627 
628  ast_assert(ast_dns_record_get_rr_type(record) == T_NAPTR);
629  return naptr->replacement;
630 }
const char * replacement
The replacement from the NAPTR record.
Definition: dns_internal.h:102
#define ast_assert(a)
Definition: utils.h:695
Definition: enum.h:28
A NAPTR record.
Definition: dns_internal.h:92
int ast_dns_record_get_rr_type(const struct ast_dns_record *record)
Get the resource record type of a DNS record.
Definition: dns_core.c:145

◆ ast_dns_naptr_get_service()

const char* ast_dns_naptr_get_service ( const struct ast_dns_record record)

Get the service from a NAPTR record.

Parameters
recordThe DNS record
Returns
the service

Definition at line 608 of file dns_naptr.c.

References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_naptr_record::service.

Referenced by AST_TEST_DEFINE(), and sip_resolve_handle_naptr().

609 {
610  struct ast_dns_naptr_record *naptr = (struct ast_dns_naptr_record *) record;
611 
612  ast_assert(ast_dns_record_get_rr_type(record) == T_NAPTR);
613  return naptr->service;
614 }
#define ast_assert(a)
Definition: utils.h:695
const char * service
The service from the NAPTR record.
Definition: dns_internal.h:98
Definition: enum.h:28
A NAPTR record.
Definition: dns_internal.h:92
int ast_dns_record_get_rr_type(const struct ast_dns_record *record)
Get the resource record type of a DNS record.
Definition: dns_core.c:145