source: trunk/third/cns/src/include/c-vms.h @ 8789

Revision 8789, 4.0 KB checked in by ghudson, 28 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r8788, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2 * Configuration file for VMS Kerberos hosts.
3 *
4 * Handles definitions specific to Berkeley Sockets as provided by
5 * MULTINET under VMS.
6 *
7 * Created by John Gilmore, Cygnus Support.
8 * Modified by Mark Eichin, Cygnus Support.
9 * Copyright 1994 Cygnus Support.
10 *
11 * Permission to use, copy, modify, and
12 * distribute this software and its documentation for any purpose and
13 * without fee is hereby granted, provided that the above copyright
14 * notice appear in all copies and that both that copyright notice and
15 * this permission notice appear in supporting documentation.
16 * Cygnus Support makes no representations about the suitability of
17 * this software for any purpose.  It is provided "as is" without express
18 * or implied warranty.
19 */
20
21/* Define u_char, u_short, u_int, and u_long. */
22#include <sys/types.h>
23
24/* If this source file requires it, define struct sockaddr_in
25   (and possibly other things related to network I/O).  FIXME.  */
26#ifdef DEFINE_SOCKADDR
27/* It appears that the multinet include path won't let us include
28   netinet/in.h directly, though we never figured out why. --eichin */
29#include "multinet_root:[multinet.include.netinet]in.h" /* For struct sockaddr_in and in_addr */
30#include "multinet_root:[multinet.include.arpa]inet.h" /* For inet_ntoa */
31#include <netdb.h>              /* For struct hostent, gethostbyname, etc */
32#include <sys/param.h>          /* For MAXHOSTNAMELEN */
33#include <sys/socket.h>         /* For SOCK_*, AF_*, etc */
34#include <sys/time.h>           /* For struct timeval */
35#ifdef NEED_TIME_H
36#include <time.h>               /* For localtime, etc */
37#endif
38#endif
39
40/*
41 * TIME_GMT_UNIXSEC returns the current time of day, in Greenwich Mean Time,
42 * as its unsigned KRB_INT32 result.  The result is in seconds since
43 * January 1, 1970, as used in Unix.
44 *
45 * TIME_GMT_UNIXSEC_US does the above, and also returns the number of
46 * microseconds that have passed in the current second, through
47 * the argument pointer *us, which points to an unsigned KRB_INT32.
48 */
49 
50/* Unfortunately, KRB_INT32 isn't defined here yet.  Push the declaration
51   into a macro, which krb.h will expand as needed at an appropriate point.  */
52#define DECL_THAT_NEEDS_KRB_INT32       \
53        extern  unsigned KRB_INT32      unix_time_gmt_unixsec \
54                                        PROTOTYPE ((unsigned KRB_INT32 *));
55
56#define TIME_GMT_UNIXSEC        unix_time_gmt_unixsec((unsigned KRB_INT32 *)0)
57#define TIME_GMT_UNIXSEC_US(us) unix_time_gmt_unixsec((us))
58#define CONVERT_TIME_EPOCH      ((long)0)       /* Unix epoch is Krb epoch */
59
60
61
62/*
63 * Return some "pretty" random values in KRB_INT32's.  This is not
64 * very random but is what the old Kerberos did.  Improving the
65 * randomness would help a lot here.  Need to include something
66 * that changes on each server to avoid multiple servers using the
67 * same random keystream.
68 */
69#define RANDOM_KRB_INT32_1      ((KRB_INT32) getpid())
70
71#ifdef  NO_GETHOSTID
72#define RANDOM_KRB_INT32_2      (0)  /* gethostid isn't that random anyway. */
73#else
74#define RANDOM_KRB_INT32_2      ((KRB_INT32) gethostid())
75#endif
76
77/* extern int getpid();  -- this will default, and some systems explicitly
78                                declare pid_t rather than int (sigh).  */
79
80extern long gethostid();
81
82/*
83 * Compatability with WinSock calls on MS-Windows...
84 */
85#define SOCKET          unsigned int
86#define INVALID_SOCKET  ((SOCKET)~0)
87#define closesocket     close
88#define ioctlsocket     ioctl
89#define SOCKET_ERROR    (-1)
90
91/* Some of our own infrastructure where the WinSock stuff was too hairy
92   to dump into a clean Unix program...  */
93
94#define SOCKET_INITIALIZE()     (0)     /* No error (or anything else) */
95#define SOCKET_CLEANUP()        /* nothing */
96#define SOCKET_ERRNO            errno
97#define SOCKET_SET_ERRNO(x)     (errno = (x))
98#define SOCKET_READ             socket_read  /* this assumes Multinet, as do other things */
99#define SOCKET_WRITE            socket_write
100#define SOCKET_EINTR            EINTR
101
102
103/*
104 * Deal with FAR pointers needed in coping with Windows DLL's.
105 * I really hate to add this crap Crap CRAP to a clean program!
106 *
107 * There ain't no such thing on real Unix machines, so this is easy.
108 */
109#define FAR             /* no such thing in real machines */
110#define _fmemcpy        memcpy
111#define _fstrncpy       strncpy
112#define far_fputs       fputs
Note: See TracBrowser for help on using the repository browser.