summaryrefslogtreecommitdiff
path: root/ACE/apps/drwho/global.h
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/apps/drwho/global.h')
-rw-r--r--ACE/apps/drwho/global.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/ACE/apps/drwho/global.h b/ACE/apps/drwho/global.h
new file mode 100644
index 00000000000..e81e25050d2
--- /dev/null
+++ b/ACE/apps/drwho/global.h
@@ -0,0 +1,53 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// drwho
+//
+// = FILENAME
+// global.h
+//
+// = DESCRIPTION
+// Here are all the declarations that are needed throughout the program. */
+//
+// = AUTHOR
+// Douglas C. Schmidt
+//
+// ============================================================================
+
+#ifndef _GLOBAL_H
+#define _GLOBAL_H
+
+#include "ace/config-all.h"
+#include "ace/Basic_Types.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+// These constants are used throughout drwho.
+
+enum
+{
+ MAXUSERIDNAMELEN = 8,
+ MAX_USER_TIMEOUT = 300,
+ MAX_HOST_TIMEOUT = 300,
+ UDP_PACKET_SIZE = 1024 * 8,
+ PORT_NUMBER = 12344
+};
+
+// Default name of file where friends info is stored.
+#define FRIEND_FILE ".friends.dta"
+
+// Default name where rwho info is stored.
+#define RWHODIR "/usr/spool/rwho"
+
+// Macros for handling message types.
+#define GET_PACKET_TYPE(P) (ACE_NTOHS (*((short *) P)))
+#define SET_PACKET_TYPE(P,T) ((*(short *) P) = ACE_NTOHS (T))
+#define SKIP_PACKET_TYPE(P) ((P) + sizeof (short))
+#define SUBTRACT_PACKET_TYPE(L) ((L) - sizeof (short))
+
+#endif /* _GLOBAL_H */