diff options
Diffstat (limited to 'src/libutil/addr.h')
-rw-r--r-- | src/libutil/addr.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/libutil/addr.h b/src/libutil/addr.h index 049cc88c3..706f2bf87 100644 --- a/src/libutil/addr.h +++ b/src/libutil/addr.h @@ -95,4 +95,27 @@ gboolean rspamd_ip_is_valid (rspamd_inet_addr_t *addr); */ gint rspamd_accept_from_socket (gint sock, rspamd_inet_addr_t *addr); +gboolean rspamd_parse_host_port_priority_strv (gchar **tokens, + rspamd_inet_addr_t *addr, guint *priority, guint default_port); + +/** + * Parse host[:port[:priority]] line + * @param ina host address + * @param port port + * @param priority priority + * @return TRUE if string was parsed + */ +gboolean rspamd_parse_host_port_priority (const gchar *str, + rspamd_inet_addr_t *addr, guint *priority, guint default_port); + +/** + * Parse host:port line + * @param ina host address + * @param port port + * @return TRUE if string was parsed + */ +gboolean rspamd_parse_host_port (const gchar *str, + rspamd_inet_addr_t *addr, guint default_port); + + #endif /* ADDR_H_ */ |