|
|
1.1 root 1: ...
2:
3: #define myservice "servicestore"
4: #define mycontext "local service"
5: #define mypci "local service pci"
6:
7: ...
8:
9: int sd;
10: struct SSAPref sfs;
11: register struct SSAPref *sf;
12: register struct PSAPaddr *pa;
13: struct AcSAPconnect accs;
14: register struct AcSAPconnect *acc = &accs;
15: struct AcSAPindication acis;
16: register struct AcSAPindication *aci = &acis;
17: register struct AcSAPabort *aca = &aci -> aci_abort;
18: AEI aei;
19: OID ctx,
20: pci;
21: struct PSAPctxlist pcs;
22: register struct PSAPctxlist *pc = &pcs;
23: struct RoSAPindication rois;
24: register struct RoSAPindication *roi = &rois;
25: register struct RoSAPpreject *rop = &roi -> roi_preject;
26:
27: if ((aei = _str2aei (argv[1], myservice, mycontext, 0)) == NULLAEI)
28: adios (NULLCP, "unable to resolve service: %s", PY_pepy);
29: if ((pa = aei2addr (aei)) == NULLPA)
30: adios (NULLCP, "address translation failed");
31:
32: if ((ctx = ode2oid (mycontext)) == NULLOID)
33: adios (NULLCP, "%s: unknown object descriptor", mycontext);
34: if ((ctx = oid_cpy (ctx)) == NULLOID)
35: adios (NULLCP, "out of memory");
36: if ((pci = ode2oid (mypci)) == NULLOID)
37: adios (NULLCP, "%s: unknown object descriptor", mypci);
38: if ((pci = oid_cpy (pci)) == NULLOID)
39: adios (NULLCP, "out of memory");
40: pc -> pc_nctx = 1;
41: pc -> pc_ctx[0].pc_id = 1;
42: pc -> pc_ctx[0].pc_asn = pci;
43: pc -> pc_ctx[0].pc_atn = NULLOID;
44:
45: if ((sf = addr2ref (PLocalHostName ())) == NULL) {
46: sf = &sfs;
47: (void) bzero ((char *) sf, sizeof *sf);
48: }
49:
50: if (AcAssocRequest (ctx, NULLAEI, aei, NULLPA, pa, pc, NULLOID,
51: 0, ROS_MYREQUIRE, SERIAL_NONE, 0, sf, NULLPEP, 0, NULLQOS,
52: acc, aci)
53: == NOTOK)
54: acs_adios (aca, "A-ASSOCIATE.REQUEST");
55:
56: if (acc -> acc_result != ACS_ACCEPT)
57: adios (NULLCP, "association rejected: [%s]",
58: AcErrString (acc -> acc_result));
59:
60: sd = acc -> acc_sd;
61: ACCFREE (acc);
62:
63: if (RoSetService (sd, RoPService, roi) == NOTOK)
64: ros_adios (rop, "set RO/PS fails");
65:
66: ...
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.