diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-10-28 14:03:46 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-10-28 14:03:46 +0000 |
commit | 4a4ff2f073debbe1b5967121fc4e1782bd004ed6 (patch) | |
tree | 7ca63f491039ade73ddcc0d93e8b3aa0918e5c59 /src/libutil/addr.h | |
parent | b4ce748572e3097982b951fac69c0e65db8b4118 (diff) | |
download | rspamd-4a4ff2f073debbe1b5967121fc4e1782bd004ed6.tar.gz rspamd-4a4ff2f073debbe1b5967121fc4e1782bd004ed6.zip |
Rework host/port/priority parsing.
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_ */ |