WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJLIB Reference

Data Structures

union  pj_ip_route_entry
 
struct  pj_enum_ip_option
 

Functions

void pj_enum_ip_option_default (pj_enum_ip_option *opt)
 
pj_status_t pj_enum_ip_interface (int af, unsigned *count, pj_sockaddr ifs[])
 
pj_status_t pj_enum_ip_interface2 (const pj_enum_ip_option *opt, unsigned *count, pj_sockaddr ifs[])
 
pj_status_t pj_enum_ip_route (unsigned *count, pj_ip_route_entry routes[])
 

Detailed Description

This module provides functions to query local host's IP interface and routing table.

Function Documentation

◆ pj_enum_ip_interface()

pj_status_t pj_enum_ip_interface ( int  af,
unsigned *  count,
pj_sockaddr  ifs[] 
)

Enumerate the local IP interfaces currently active in the host.

Parameters
afFamily of the address to be retrieved. Application may specify pj_AF_UNSPEC() to retrieve all addresses, or pj_AF_INET() or pj_AF_INET6() to retrieve interfaces with specific address family.
countOn input, specify the number of entries. On output, it will be filled with the actual number of entries.
ifsArray of socket addresses, which address part will be filled with the interface address. The address family part will be initialized with the address family of the IP address.
Returns
PJ_SUCCESS on success, or the appropriate error code.

◆ pj_enum_ip_interface2()

pj_status_t pj_enum_ip_interface2 ( const pj_enum_ip_option opt,
unsigned *  count,
pj_sockaddr  ifs[] 
)

Enumerate the local IP interfaces currently active in the host with capability to filter DEPRECATED IPv6 addresses (currently only for Linux).

Parameters
optThe option, default option will be used if NULL.
countOn input, specify the number of entries. On output, it will be filled with the actual number of entries.
ifsArray of socket (with flags) addresses, which address part will be filled with the interface address. The address family part will be initialized with the address family of the IP address.
Returns
PJ_SUCCESS on success, or the appropriate error code.

◆ pj_enum_ip_option_default()

void pj_enum_ip_option_default ( pj_enum_ip_option opt)

Get default values of IP enumeration option.

Parameters
optThe IP enumeration option.

References pj_bzero().

◆ pj_enum_ip_route()

pj_status_t pj_enum_ip_route ( unsigned *  count,
pj_ip_route_entry  routes[] 
)

Enumerate the IP routing table for this host.

Parameters
countOn input, specify the number of routes entries. On output, it will be filled with the actual number of route entries.
routesArray of IP routing entries.
Returns
PJ_SUCCESS on success, or the appropriate error code.

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.