#include #include #include #include #include #include #include #include #define LNSIZE 80 /* max length of an input line */ #define BUFSIZE 4096 /* max size of a record */ #define MAXSVCS 10000 /* max number of services in linked list */ /* linked list structure to store all services in objects.C */ typedef struct services { int svccount; /* current service number */ char svcname[LNSIZE]; /* service name */ char *group[LNSIZE]; /* stores services of type 'group' */ char port[LNSIZE]; /* defines ports for this service */ char type[LNSIZE]; /* defines type of service */ struct services *nodelink; /* pointer to next structure element */ } services; /* defines pointers to linked list of services */ services *shead, *sprev, *spresent, *snext, *stail; /* used in rules to find the next service entry */ void parse_svc(FILE *fp, int objcount, char *objname); /* used in rules to insert the next service entry into rules structure */ void insert_service(char *svcname, char *serv, int svccount); /* allocate space and initial data for services structure */ void initservices(void); /* searches the objects structure looking for specific service names */ void find_services(char *serv); /* This routine locates all network services in the objects.C file, and * passes them one-by-one to the parse_svc() function to be inserted * into the proper structure. */ void find_svc(char *objectsC); /* This routine can be used to print out the entire list of * services. Some services are actually groups, that contain * a list of services. It will print those as well. */ void dump_svc(int verbose);