removed unneeded constructor
authorMartin Willi <martin@strongswan.org>
Thu, 31 Aug 2006 06:16:52 +0000 (06:16 -0000)
committerMartin Willi <martin@strongswan.org>
Thu, 31 Aug 2006 06:16:52 +0000 (06:16 -0000)
src/libstrongswan/utils/host.c
src/libstrongswan/utils/host.h

index d0f4f96..4492578 100644 (file)
@@ -483,21 +483,6 @@ host_t *host_create_from_string(char *string, u_int16_t port)
 /*
  * Described in header.
  */
-host_t *host_create_from_hdr(u_long address, u_short port)
-{
-       private_host_t *this = host_create_empty();
-       
-       this->address.sa_family = AF_INET;
-       this->address4.sin_addr.s_addr = address;
-       this->address4.sin_port = port;
-       this->socklen = sizeof(struct sockaddr_in);
-       set_string(this);
-       return &this->public;
-}
-
-/*
- * Described in header.
- */
 host_t *host_create_from_chunk(int family, chunk_t address, u_int16_t port)
 {
        private_host_t *this = host_create_empty();
@@ -546,10 +531,12 @@ host_t *host_create_from_sockaddr(sockaddr_t *sockaddr)
        switch (sockaddr->sa_family)
        {
                case AF_INET:
+               {
                        memcpy(&this->address4, sockaddr, sizeof(struct sockaddr_in));
                        this->socklen = sizeof(struct sockaddr_in);
                        set_string(this);
                        return &this->public;
+               }
                case AF_INET6:
                {
                        memcpy(&this->address6, sockaddr, sizeof(struct sockaddr_in6));
index 32abe56..b9a97b1 100644 (file)
@@ -192,7 +192,6 @@ struct host_t {
 /**
  * @brief Constructor to create a host_t object from an address string
  *
- *
  * @param family               Address family to use for this object, such as AF_INET or AF_INET6
  * @param address              string of an address, such as "152.96.193.130"
  * @param port                 port number
@@ -218,20 +217,6 @@ host_t *host_create(int family, char *address, u_int16_t port);
 host_t *host_create_from_string(char *string, u_int16_t port);
 
 /**
- * @brief Constructor to create a host_t object from raw header data
- *
- * only IPv4 (create host_create_from_hdr6 for IPv6)!
- *
- * @param address              address in network byte order
- * @param port                 port number in network byte order
- * @return
- *                                             - host_t object
- *
- * @ingroup network
- */
-host_t *host_create_from_hdr(u_long address, u_short port);
-
-/**
  * @brief Constructor to create a host_t object from an address chunk
  *
  * @param family               Address family to use for this object, such as AF_INET or AF_INET6