Lines Matching refs: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];
223 int chassis, geoslot;
225 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) {
227 if (units[chassis][geoslot].ip != NULL) {
228 free(units[chassis][geoslot].ip); /* get rid of the malloc'ed space that holds the IP address */
229 units[chassis][geoslot].ip = 0; /* then set the pointer to NULL */
231 empty_unit(chassis, geoslot);
237 int chassis, geoslot;
242 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) { /* scan the table... */
244 if (units[chassis][geoslot].ip != NULL) {
245 p = units[chassis][geoslot].iface;
264 int chassis, geoslot;
288 chassis = *(ptr2 + 3) - '0'; /* extract the chassis number */
290 if (chassis < 1 || chassis > MAX_CHASSIS ||
291 geoslot < 1 || geoslot > MAX_GEOSLOT) { /* if the chassis and/or slot numbers appear to be bad... */
300 u = &units[chassis][geoslot];
302 u->chassis = chassis;
345 static void close_with_IOP(int chassis, int geoslot, int flag) {
348 if (flag == LIVE) id = &units[chassis][geoslot].fd;
349 else id = &units[chassis][geoslot].find_fd;
358 int chassis, geoslot;
361 if (find_unit_by_fd(handle->fd, &chassis, &geoslot, &u) == 0)
363 close_with_IOP(chassis, geoslot, LIVE);
371 int chassis, geoslot;
375 find_unit_by_fd(fd, &chassis, &geoslot, NULL);
376 if (units[chassis][geoslot].fd == fd) close_with_IOP(chassis, geoslot, LIVE);
377 else if (units[chassis][geoslot].find_fd == fd) close_with_IOP(chassis, geoslot, FIND);
378 empty_unit(chassis, geoslot);
409 pcap_snprintf(buf, bufsize, "%s_%d_%d", proto, u->chassis, u->geoslot);
415 portnum = ((u->chassis - 1) * 64) + ((u->geoslot - 1) * 8) + IOPportnum + 1;
565 int chassis, geoslot;
578 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) {
580 u = &units[chassis][geoslot];
705 int chassis, geoslot;
709 find_unit_by_fd(fd, &chassis, &geoslot, &u);
724 int chassis, geoslot;
750 find_unit_by_fd(fd, &chassis, &geoslot, NULL);
751 close_with_IOP(chassis, geoslot, FIND); /* and close out connection to him */
777 int chassis, geoslot;
782 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) {
784 u = &units[chassis][geoslot];
788 close_with_IOP(chassis, geoslot, FIND);
821 int chassis, geoslot;
827 for (chassis = 0; chassis <= MAX_CHASSIS; chassis++) { /* scan the table... */
829 u = &units[chassis][geoslot];