Home | History | Annotate | Download | only in libpcap

Lines Matching full:chassis

49 #define MAX_CHASSIS			8				/* number of chassis in an ACN site */
68 int chassis;
143 int chassis, geoslot;
147 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) {
149 if (units[chassis][geoslot].ip != NULL)
150 printf("%d:%d %2d %s\n", chassis, geoslot, units[chassis][geoslot].fd, units[chassis][geoslot].ip);
151 p = units[chassis][geoslot].iface;
162 static int find_unit_by_fd(int fd, int *chassis, int *geoslot, unit_t **unit_ptr) {
168 if (chassis) *chassis = c;
180 int chassis, geoslot;
183 find_unit_by_fd(fd, &chassis, &geoslot, &u);
206 static void empty_unit(int chassis, int geoslot) {
207 unit_t *u = &units[chassis][geoslot];
219 int chassis, geoslot;
221 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) {
223 if (units[chassis][geoslot].ip != NULL) {
224 free(units[chassis][geoslot].ip); /* get rid of the malloc'ed space that holds the IP address */
225 units[chassis][geoslot].ip = 0; /* then set the pointer to NULL */
227 empty_unit(chassis, geoslot);
233 int chassis, geoslot;
238 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) { /* scan the table... */
240 if (units[chassis][geoslot].ip != NULL) {
241 p = units[chassis][geoslot].iface;
260 int chassis, geoslot;
284 chassis = *(ptr2 + 3) - '0'; /* extract the chassis number */
286 if (chassis < 1 || chassis > MAX_CHASSIS ||
287 geoslot < 1 || geoslot > MAX_GEOSLOT) { /* if the chassis and/or slot numbers appear to be bad... */
296 u = &units[chassis][geoslot];
298 u->chassis = chassis;
341 static void close_with_IOP(int chassis, int geoslot, int flag) {
344 if (flag == LIVE) id = &units[chassis][geoslot].fd;
345 else id = &units[chassis][geoslot].find_fd;
354 int chassis, geoslot;
357 if (find_unit_by_fd(handle->fd, &chassis, &geoslot, &u) == 0)
359 close_with_IOP(chassis, geoslot, LIVE);
367 int chassis, geoslot;
371 find_unit_by_fd(fd, &chassis, &geoslot, NULL);
372 if (units[chassis][geoslot].fd == fd) close_with_IOP(chassis, geoslot, LIVE);
373 else if (units[chassis][geoslot].find_fd == fd) close_with_IOP(chassis, geoslot, FIND);
374 empty_unit(chassis, geoslot);
405 snprintf(buf, bufsize, "%s_%d_%d", proto, u->chassis, u->geoslot);
411 portnum = ((u->chassis - 1) * 64) + ((u->geoslot - 1) * 8) + IOPportnum + 1;
561 int chassis, geoslot;
573 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) {
575 u = &units[chassis][geoslot];
698 int chassis, geoslot;
702 find_unit_by_fd(fd, &chassis, &geoslot, &u);
717 int chassis, geoslot;
743 find_unit_by_fd(fd, &chassis, &geoslot, NULL);
744 close_with_IOP(chassis, geoslot, FIND); /* and close out connection to him */
770 int chassis, geoslot;
775 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) {
777 u = &units[chassis][geoslot];
781 close_with_IOP(chassis, geoslot, FIND);
814 int chassis, geoslot;
820 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) { /* scan the table... */
822 u = &units[chassis][geoslot];