summaryrefslogtreecommitdiff
path: root/ACE/protocols/ace/HTBP/HTBP_Addr.h
blob: 21e6ec353033c72e7b91ea28d654c32bf96355b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// -*- C++ -*-

//=============================================================================
/**
 *  @file    HTBP_Addr.h
 *
 *  @author Phil Mesnier
 */
//=============================================================================

#ifndef ACE_HTBP_ADDR_H
#define ACE_HTBP_ADDR_H
#include /**/ "ace/pre.h"

#include "HTBP_Export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/INET_Addr.h"
#include "ace/Synch.h"
#include "ace/SString.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

namespace ACE
{
  namespace HTBP
  {
    /**
     * @class Addr
     *
     * @brief Defines the member functions of the pure virtual class
     * Addr
     *
     * This class derives from ACE_INET_Addr. It is the base class for
     * the Inside, Proxy and Outside classes
     */
    class HTBP_Export Addr : public ACE_INET_Addr
    {
    public:
      /// Constructor
      Addr () = default;

      Addr (const Addr &other);

      /// Create an Addr suitable for use on the inside of a firewall this
      /// take a string used to populate the htid_ member. With this address,
      /// the IP addr form is ignored.
      Addr (const char *htid);

      /// Initialize an Addr for the outside of a firewall. In this form,
      /// the htid_ is an empty string and the arguments are passed to the
      /// base address type.
      Addr (u_short port_number,
            const char host_name[],
            int address_family = AF_UNSPEC);

      /// Destructor
      virtual ~Addr () = default;

      int set (u_short port,
               const char host [],
               const char *htid);

      /// Methods to help convert the OutSide_Addr to a String
      /// and vice versa
      int addr_to_string (ACE_TCHAR buffer[],
                          size_t size,
                          int ipaddr_format = 1) const;
      int string_to_addr (const char address[],
                          int address_facmily = AF_UNSPEC);

      int set_htid(const char *htid);
      const char *get_htid () const;

    private:
      /// HTID - web-obtained unique-identifier
      ACE_CString htid_;
    };
  }
}

ACE_END_VERSIONED_NAMESPACE_DECL

#include /**/ "ace/post.h"
#endif /* ACE_HTBP_ADDR_H */