diff options
author | Martin Willi <martin@strongswan.org> | 2005-11-16 16:11:08 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2005-11-16 16:11:08 +0000 |
commit | 050ce09b6f4c7368ce6e48ebf68e5b8f4a2ac4d0 (patch) | |
tree | 0d10863a429ae13f7fd0765deb3294760b4a6134 /Source/charon/utils/host.h | |
parent | 146e568fe70fc289f65cc0e8d399f9d86e13bf70 (diff) | |
download | strongswan-050ce09b6f4c7368ce6e48ebf68e5b8f4a2ac4d0.tar.bz2 strongswan-050ce09b6f4c7368ce6e48ebf68e5b8f4a2ac4d0.tar.xz |
- host_t for storing host address
Diffstat (limited to 'Source/charon/utils/host.h')
-rw-r--r-- | Source/charon/utils/host.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Source/charon/utils/host.h b/Source/charon/utils/host.h new file mode 100644 index 000000000..1ef9676a3 --- /dev/null +++ b/Source/charon/utils/host.h @@ -0,0 +1,58 @@ +/** + * @file host.h + * + * @brief host object, identifies a host and defines some useful functions on it. + * + */ + +/* + * Copyright (C) 2005 Jan Hutter, Martin Willi + * Hochschule fuer Technik Rapperswil + * + * This program 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 2 of the License, or (at your + * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. + * + * This program 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. + */ + +#ifndef HOST_H_ +#define HOST_H_ + +#include <stdlib.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> + +#include "../types.h" + +/** + * @brief The logger object + */ +typedef struct host_s host_t; +struct host_s { + status_t (*clone) (host_t *this, host_t **other); + sockaddr_t *(*get_sockaddr) (host_t *this); + socklen_t *(*get_sockaddr_len) (host_t *this); + status_t (*destroy) (host_t *this); +}; + +/** + * @brief Constructor to create a logger_t object. + * + * @param logger_name Name for the logger_t object + * @param log_level or'ed set of log_levels to assign to the new logger_t object + * @param output FILE * if log has to go on a file output, NULL for syslog + * @return logger_t object or NULL if failed + */ +host_t *host_create(int family, char *address, u_int16_t port); + + + +#endif /*HOST_H_*/ |