mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-09 22:45:49 +00:00
pjsip cli: Change Identify to show CIDR notation instead of netmasks.
* Added ast_sockaddr_cidr_bits() to count the 1 bits in an ast_sockaddr. * Added ast_ha_join_cidr() which uses ast_sockaddr_cidr_bits() for the netmask instead of ast_sockaddr_stringify_addr. * Changed res_pjsip_endpoint_identifier_ip to call ast_ha_join_cidr() instead of ast_ha_join() for the CLI output. This is a CLI change only. AMI was not affected. Tested by: George Joseph Review: https://reviewboard.asterisk.org/r/3652/ ........ Merged revisions 416737 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -262,6 +262,16 @@ static inline char *ast_sockaddr_stringify_addr(const struct ast_sockaddr *addr)
|
||||
return ast_sockaddr_stringify_fmt(addr, AST_SOCKADDR_STR_ADDR);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \since 12.4
|
||||
*
|
||||
* \brief
|
||||
* Count the 1 bits in a netmask
|
||||
*
|
||||
* \return number of 1 bits
|
||||
*/
|
||||
int ast_sockaddr_cidr_bits(const struct ast_sockaddr *sa);
|
||||
|
||||
/*!
|
||||
* \since 1.8
|
||||
*
|
||||
|
Reference in New Issue
Block a user