summaryrefslogtreecommitdiff
path: root/ace/SPIPE_Addr.h
blob: 0a758250f0eb065e115c56ba43b3ee8b8d804bd8 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
/* -*- C++ -*- */
// $Id$


// ============================================================================
//
// = LIBRARY
//    ace
// 
// = FILENAME
//    SPIPE_Addr.h
//
// = AUTHOR
//    Doug Schmidt 
// 
// ============================================================================

#if !defined (ACE_SPIPE_ADDR_H)
#define ACE_SPIPE_ADDR_H
#include "ace/Addr.h"
#include "ace/ACE.h"

class ACE_Export ACE_SPIPE_Addr : public ACE_Addr
  // = TITLE
  //    Defines the SVR4 STREAM pipe address family address format. 
{
public:
  // = Initialization methods.
  ACE_SPIPE_Addr (void);
  // Default constructor.

  ACE_SPIPE_Addr (const ACE_SPIPE_Addr &sa);
  // Copy constructor.

  ACE_SPIPE_Addr (LPCTSTR rendezvous_point, gid_t = 0, uid_t = 0);
  // Create a ACE_SPIPE_Addr from a rendezvous point in the file system.

  int set (LPCTSTR rendezvous_point, gid_t = 0, uid_t = 0);
  // Create a ACE_SPIPE_Addr from a rendezvous point in the file system.

  virtual void *get_addr (void) const;
  // Return a pointer to the address.

  virtual void set_addr (void *addr, int len);
  // Set a pointer to the underlying network address.

  virtual int addr_to_string (LPTSTR addr, size_t) const;
  // Transform the current address into string format. 

  virtual int string_to_addr (LPCTSTR addr);
  // Transform the string into the current addressing format.

  // = Equality/inequality tests
  virtual int operator == (const ACE_Addr &SAP) const;
  // Check for equality.

  virtual int operator != (const ACE_Addr &SAP) const;
  // Check for inequality

  // = SPIPE-specific address operations
  LPCTSTR get_path_name (void) const; 
  // Pathname of rendezvous point in file system.

  uid_t user_id (void) const;
  // Get user id.
  void user_id (uid_t uid);
  // Set user id.

  void group_id (gid_t gid);
  // Set group ids.
  gid_t group_id (void) const;
  // Get group ids.

  void dump (void) const;
  // Dump the state of an object.

  ACE_ALLOC_HOOK_DECLARE;
  // Declare the dynamic allocation hooks.

private:
  // = This struct contains security attributes.
  struct 
  {
    gid_t gid_;
    // Group id.

    uid_t uid_;
    // User id.

    TCHAR rendezvous_[MAXNAMLEN + 1];
    // Pathname in the file system.

  } SPIPE_addr_;
  // Contents of an SPIPE address.
};

#if defined (__ACE_INLINE__)
#include "ace/SPIPE_Addr.i"
#endif /* __ACE_INLINE__ */

#endif /* ACE_SPIPE_ADDR_H */