2
0
Fork 0
lighttpd2/include/lighttpd/ip_parsers.h

15 lines
741 B
C
Raw Normal View History

#ifndef _LIGHTTPD_IP_PARSERS_H_
#define _LIGHTTPD_IP_PARSERS_H_
#include <lighttpd/settings.h>
2009-09-04 13:56:52 +00:00
/** optional parameters are set to default values (netmask all bits, port 0) */
/** parse an IPv4 (if netmask is not NULL with optional cidr netmask, if port is not NULL with optional port) */
2009-07-09 20:17:24 +00:00
LI_API gboolean li_parse_ipv4(const char *str, guint32 *ip, guint32 *netmask, guint16 *port);
/** parse an IPv6 (if network is not NULL with optional cidr network, if port is not NULL with optional port if the ip/cidr part is in [...]) */
2009-07-09 20:17:24 +00:00
LI_API gboolean li_parse_ipv6(const char *str, guint8 *ip, guint *network, guint16 *port);
/** print the ip into dest, return dest */
2009-07-09 20:17:24 +00:00
LI_API GString* li_ipv6_tostring(GString *dest, const guint8 ip[16]);
#endif