/* isoentity.c - application entity titles -- sequential lookup utilities */
static char *rcsid
= "$Header: /f/osi/acsap/RCS/isoentity.c,v 7.4 91/02/22 09:14:42 mrose Interim $";
* $Header: /f/osi/acsap/RCS/isoentity.c,v 7.4 91/02/22 09:14:42 mrose Interim $
* Revision 7.4 91/02/22 09:14:42 mrose
* Revision 7.3 90/12/23 18:39:15 mrose
* Revision 7.2 90/10/29 18:38:00 mrose
* Revision 7.1 90/08/08 14:11:40 mrose
* Revision 7.0 89/11/23 21:22:13 mrose
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
static char *isoentities
= "isoentities";
static FILE *servf
= NULL
;
static char buffer
[BUFSIZ
+ 1];
static char *vec
[NVEC
+ NSLACK
+ 1];
static struct isoentity ies
;
servf
= fopen (isodefile (isoentities
, 0), "r");
if (servf
&& !stayopen
) {
struct isoentity
*getisoentity () {
static char descriptor
[BUFSIZ
];
&& (servf
= fopen (isodefile (isoentities
, 0), "r")) == NULL
)
while (_startisoentity (descriptor
) == OK
)
if (_stopisoentity (descriptor
, (struct isoentity
*) NULL
) == OK
)
int _startisoentity (descriptor
)
ep
= (dp
= buffer
) + sizeof buffer
;
while (fgets (dp
, ep
- dp
, servf
) != NULL
) {
if (*dp
== '\n' && dp
== buffer
)
if (cp
= index (buffer
, '\n')) {
switch (vecp
= str2vecX (buffer
, vec
, 5 + 1, &mask
, NULL
, 1)) {
(void) sprintf (descriptor
, "%s-%s", vec
[0], vec
[1]);
int _stopisoentity (descriptor
, iep
)
register struct isoentity
*ie
= &ies
;
OID oid
= &ie
-> ie_identifier
;
struct PSAPaddr
*pa
= &ie
-> ie_addr
;
static unsigned int elements
[NELEM
+ 1];
bzero ((char *) ie
, sizeof *ie
);
if (strcmp (vec
[2], "NULL") == 0)
if ((i
= str2elem (vec
[2], elements
)) <= 1)
oid
-> oid_elements
= elements
;
ie
-> ie_descriptor
= descriptor
;
if (pz
= str2paddr (vec
[3]))
*pa
= *pz
; /* struct copy */
*iep
= *ie
; /* struct copy */
register struct isoentity
*ie
;
LLOG (addr_log
, LLOG_DEBUG
,
("Entity: %s (%s)", ie
-> ie_descriptor
,
oid2ode (&ie
-> ie_identifier
)));
(void) ll_printf (addr_log
, "Address: %s\n",
paddr2str (&ie
-> ie_addr
, NULLNA
));
(void) ll_printf (addr_log
, "///////\n");
(void) ll_sync (addr_log
);