|
|
1.1 root 1: ...
2:
3: static struct dispatch dispatches[] = {
4: /* real user-supplied routines go here... */
5:
6: "help", 0, do_help, NULLIFP, NULLIFP, NULLIFP,
7: "print this information",
8: "quit", 0, do_quit, NULLIFP, NULLIFP, NULLIFP,
9: "terminate the association and exit",
10:
11: NULL
12: };
13:
14:
15: /* ARGSUSED */
16:
17: static int do_help (sd, ds, args, dummy)
18: int sd;
19: register struct dispatch *ds;
20: char **args;
21: caddr_t *dummy;
22: {
23: printf ("\nCommands are:\n");
24: for (ds = dispatches; ds -> ds_name; ds++)
25: printf ("%s\t%s\n", ds -> ds_name, ds -> ds_help);
26:
27: return NOTOK;
28: }
29:
30:
31: /* ARGSUSED */
32:
33: static int do_quit (sd, ds, args, dummy)
34: int sd;
35: struct dispatch *ds;
36: char **args;
37: caddr_t *dummy;
38: {
39: struct AcSAPrelease acrs;
40: register struct AcSAPrelease *acr = &acrs;
41: struct AcSAPindication acis;
42: register struct AcSAPindication *aci = &acis;
43: register struct AcSAPabort *aca = &aci -> aci_abort;
44:
45: if (AcRelRequest (sd, ACF_NORMAL, NULLPEP, 0, NOTOK, acr, aci) == NOTOK)
46: acs_adios (aca, "A-RELEASE.REQUEST");
47:
48: if (!acr -> acr_affirmative) {
49: (void) AcUAbortRequest (sd, NULLPEP, 0, aci);
50: adios (NULLCP, "release rejected by peer: %d", acr -> acr_reason);
51: }
52:
53: ACRFREE (acr);
54:
55: exit (0);
56: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.