summaryrefslogtreecommitdiff
path: root/apps/drwho/global.h
blob: 090b20b5b33b45f7bfa5fd6118482d614cea0417 (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
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    drwho
//
// = FILENAME
//    global.h
//
// = DESCRIPTION
//    Here are all the declarations that are needed throughout the program. */
//
// = AUTHOR
//    Douglas C. Schmidt
//
// ============================================================================

#if !defined (_GLOBAL_H)
#define _GLOBAL_H

#include "ace/OS.h"

// 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)      (ntohs (*((short *) P)))
#define SET_PACKET_TYPE(P,T)    ((*(short *) P) = ntohs (T))
#define SKIP_PACKET_TYPE(P)     ((P) + sizeof (short))
#define SUBTRACT_PACKET_TYPE(L) ((L) - sizeof (short)) 

#endif /* _GLOBAL_H */