simple-multicast  0.2.1
 All Files Functions Typedefs Macros Pages
Functions
testip.h File Reference

Library to test ip validity. More...

#include "compatibility.h"
Include dependency graph for testip.h:

Go to the source code of this file.

Functions

int is_valid_ip (const char *my_ip_str)
 Verifies if IP address in "my_ip_str" is a valid ip.
bool is_valid_mcast_ip4 (const char *my_ip_str)
 Verifies if IP address in "my_ip_str" is a valid IPv4 multicast address.
bool is_valid_ssm_ip4 (const char *my_ip_str)
 Verifies if IP address in "my_ip_str" is a valid IPv4 SSM address.

Detailed Description

Library to test ip validity.

Author
Andrea Florio andre.nosp@m.a@op.nosp@m.ensus.nosp@m.e.or.nosp@m.g
Version
0.1
Date
2013

License

Copyright (C) 2013
Andrea Florio 2013 andre.nosp@m.a@op.nosp@m.ensus.nosp@m.e.or.nosp@m.g

This Project is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This Project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Function Documentation

int is_valid_ip ( const char *  my_ip_str)

Verifies if IP address in "my_ip_str" is a valid ip.

Supports IPv4 and IPv6

Parameters
my_ip_strIs a string containing the ip address.
Returns
AF_INET if the ip is a valid IPv4 address, AF_INET6 is the function is a valid IPv6 address else returns -1
bool is_valid_mcast_ip4 ( const char *  my_ip_str)

Verifies if IP address in "my_ip_str" is a valid IPv4 multicast address.

Parameters
my_ip_strIs a string containing the ip address.
Returns
#TRUE if the string is a valid IPv4 Multicast address, #FALSE otherwise
bool is_valid_ssm_ip4 ( const char *  my_ip_str)

Verifies if IP address in "my_ip_str" is a valid IPv4 SSM address.

Parameters
my_ip_strIs a string containing the ip address.
Returns
#TRUE if the string is a valid IPv4 SSM address, #FALSE otherwise