dns_srv.h File Reference

DNS SRV 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_srv_get_host (const struct ast_dns_record *record)
 Get the hostname from an SRV record.
unsigned short ast_dns_srv_get_port (const struct ast_dns_record *record)
 Get the port from an SRV record.
unsigned short ast_dns_srv_get_priority (const struct ast_dns_record *record)
 Get the priority from an SRV record.
unsigned short ast_dns_srv_get_weight (const struct ast_dns_record *record)
 Get the weight from an SRV record.


Detailed Description

DNS SRV Record Parsing API.

Author:
Joshua Colp <jcolp@digium.com>

Definition in file dns_srv.h.


Function Documentation

const char* ast_dns_srv_get_host ( const struct ast_dns_record record  ) 

Get the hostname from an SRV record.

Parameters:
record The DNS record
Returns:
the hostname

Definition at line 182 of file dns_srv.c.

References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_srv_record::host.

Referenced by AST_TEST_DEFINE(), and nominal_test().

00183 {
00184    struct ast_dns_srv_record *srv = (struct ast_dns_srv_record *) record;
00185 
00186    ast_assert(ast_dns_record_get_rr_type(record) == ns_t_srv);
00187    return srv->host;
00188 }

unsigned short ast_dns_srv_get_port ( const struct ast_dns_record record  ) 

Get the port from an SRV record.

Parameters:
record The DNS record
Returns:
the port

Definition at line 206 of file dns_srv.c.

References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_srv_record::port.

Referenced by AST_TEST_DEFINE(), and nominal_test().

00207 {
00208    struct ast_dns_srv_record *srv = (struct ast_dns_srv_record *) record;
00209 
00210    ast_assert(ast_dns_record_get_rr_type(record) == ns_t_srv);
00211    return srv->port;
00212 }

unsigned short ast_dns_srv_get_priority ( const struct ast_dns_record record  ) 

Get the priority from an SRV record.

Parameters:
record The DNS record
Returns:
the priority

Definition at line 190 of file dns_srv.c.

References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_srv_record::priority.

Referenced by AST_TEST_DEFINE(), and nominal_test().

00191 {
00192    struct ast_dns_srv_record *srv = (struct ast_dns_srv_record *) record;
00193 
00194    ast_assert(ast_dns_record_get_rr_type(record) == ns_t_srv);
00195    return srv->priority;
00196 }

unsigned short ast_dns_srv_get_weight ( const struct ast_dns_record record  ) 

Get the weight from an SRV record.

Parameters:
record The DNS record
Returns:
the weight

Definition at line 198 of file dns_srv.c.

References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_srv_record::weight.

Referenced by AST_TEST_DEFINE(), and nominal_test().

00199 {
00200    struct ast_dns_srv_record *srv = (struct ast_dns_srv_record *) record;
00201 
00202    ast_assert(ast_dns_record_get_rr_type(record) == ns_t_srv);
00203    return srv->weight;
00204 }


Generated on Thu Apr 16 06:30:44 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6