source: trunk/athena/bin/rkinit/rkinitd/util.c @ 2269

Revision 2269, 1.2 KB checked in by qjb, 35 years ago (diff)
Initial revision
Line 
1/*
2 * $Header: /afs/dev.mit.edu/source/repository/athena/bin/rkinit/rkinitd/util.c,v 1.1 1989-11-12 19:36:50 qjb Exp $
3 * $Source: /afs/dev.mit.edu/source/repository/athena/bin/rkinit/rkinitd/util.c,v $
4 * $Author: qjb $
5 *
6 * This file contains general rkinit server utilities.
7 */
8
9#if !defined(lint) && !defined(SABER)
10static char *rcsid = "$Header: /afs/dev.mit.edu/source/repository/athena/bin/rkinit/rkinitd/util.c,v 1.1 1989-11-12 19:36:50 qjb Exp $";
11#endif lint || SABER
12
13#include <stdio.h>
14#include <rkinit.h>
15#include <rkinit_err.h>
16#include <rkinit_private.h>
17
18static char errbuf[BUFSIZ];
19
20void rpc_exchange_version_info();
21void error();
22
23int choose_version(version)
24  int *version;
25{
26    int c_lversion;             /* lowest version number client supports */
27    int c_hversion;             /* highest version number client supports */
28    int status = RKINIT_SUCCESS;
29   
30    rpc_exchange_version_info(&c_lversion, &c_hversion,
31                                  RKINIT_LVERSION, RKINIT_HVERSION);
32   
33    *version = min(RKINIT_HVERSION, c_hversion);
34    if (*version < max(RKINIT_LVERSION, c_lversion)) {
35        sprintf(errbuf,
36                "Can't run version %d client against version %d server.",
37                c_hversion, RKINIT_HVERSION);
38        rkinit_errmsg(errbuf);
39        return(RKINIT_VERSION);
40    }
41
42    return(status);
43}
Note: See TracBrowser for help on using the repository browser.