Lines Matching refs:vntsdp
81 static vntsd_t *vntsdp; variable
92 if (thr_self() != vntsdp->tid) { in exit_sig_handler()
94 (void) thr_kill(vntsdp->tid, sig); in exit_sig_handler()
112 if (vntsdp->timeout == 0) { in vntsd_attach_timer()
116 (void) mutex_lock(&vntsdp->tmo_lock); in vntsd_attach_timer()
117 rv = vntsd_que_append(&vntsdp->tmoq, (void *)tmop); in vntsd_attach_timer()
118 (void) mutex_unlock(&vntsdp->tmo_lock); in vntsd_attach_timer()
128 if (vntsdp->timeout == 0) { in vntsd_detach_timer()
132 (void) mutex_lock(&vntsdp->tmo_lock); in vntsd_detach_timer()
133 rv = vntsd_que_rm(&vntsdp->tmoq, (void *)tmop); in vntsd_detach_timer()
134 (void) mutex_unlock(&vntsdp->tmo_lock); in vntsd_detach_timer()
145 if (tmop->minutes == vntsdp->timeout) { in chk_timeout()
172 if (vntsdp->timeout == 0) { in vntsd_reset_timer()
176 (void) mutex_lock(&vntsdp->tmo_lock); in vntsd_reset_timer()
177 (void) vntsd_que_find(vntsdp->tmoq, reset_timeout, in vntsd_reset_timer()
179 (void) mutex_unlock(&vntsdp->tmo_lock); in vntsd_reset_timer()
192 if (vntsdp->timeout == 0) { in vntsd_alarm_sig_handler()
208 (void) mutex_lock(&vntsdp->tmo_lock); in vntsd_alarm_sig_handler()
211 (void) vntsd_que_walk(vntsdp->tmoq, (el_func_t)chk_timeout); in vntsd_alarm_sig_handler()
212 (void) mutex_unlock(&vntsdp->tmo_lock); in vntsd_alarm_sig_handler()
238 (void) mutex_lock(&vntsdp->lock); in vntsd_exit()
240 if (vntsdp->timeout > 0) { in vntsd_exit()
245 vntsd_free_que(&vntsdp->grouppq, (clean_func_t)vntsd_clean_group); in vntsd_exit()
248 (void) close(vntsdp->ctrl_fd); in vntsd_exit()
250 assert(vntsdp->tmoq == NULL); in vntsd_exit()
251 (void) mutex_unlock(&vntsdp->lock); in vntsd_exit()
254 (void) mutex_destroy(&vntsdp->tmo_lock); in vntsd_exit()
255 (void) mutex_destroy(&vntsdp->lock); in vntsd_exit()
256 free(vntsdp); in vntsd_exit()
364 vntsdp = calloc(1, sizeof (vntsd_t)); in main()
365 if (vntsdp == NULL) { in main()
370 vntsdp->ctrl_fd = -1; in main()
371 vntsdp->devinst = NULL; in main()
373 (void) mutex_init(&vntsdp->lock, USYNC_THREAD|LOCK_ERRORCHECK, NULL); in main()
374 (void) mutex_init(&vntsdp->tmo_lock, USYNC_THREAD|LOCK_ERRORCHECK, in main()
382 vntsdp->options |= VNTSD_OPT_DAEMON_OFF; in main()
386 vntsdp->devinst = optarg; in main()
393 n = sscanf(optarg, "%d", &(vntsdp->timeout)); in main()
395 vntsdp->timeout = -1; in main()
414 vntsdp->options |= VNTSD_OPT_AUTH_CHECK; in main()
423 if ((vntsdp->devinst == NULL) || (vntsdp->timeout == -1)) { in main()
432 vntsdp->ip_addr.s_addr = htonl(INADDR_LOOPBACK); in main()
433 } else if ((vntsdp->options & VNTSD_OPT_AUTH_CHECK) != 0) { in main()
437 vntsdp->ip_addr.s_addr = htonl(INADDR_LOOPBACK); in main()
439 vntsdp->ip_addr.s_addr = htonl(INADDR_ANY); in main()
441 vntsdp->ip_addr.s_addr = get_listen_ip_addr(listen_addr); in main()
442 if (vntsdp->ip_addr.s_addr == VNTSD_INVALID_LISTEN_ADDR) { in main()
451 vntsdp->options, vntsdp->devinst, in main()
455 sz = strlen(VCC_DEVICE_CTL_PATH) + strlen(vntsdp->devinst) + 1; in main()
461 (void) snprintf(path, sz-1, VCC_DEVICE_CTL_PATH, vntsdp->devinst, in main()
462 sizeof (vntsdp->devinst)); in main()
463 vntsdp->ctrl_fd = open(path, O_RDWR); in main()
465 if (vntsdp->ctrl_fd == -1) { in main()
476 if ((vntsdp->options & VNTSD_OPT_DAEMON_OFF) == 0) { in main()
495 for (i = 3; i < vntsdp->ctrl_fd; i++) { in main()
498 closefrom(vntsdp->ctrl_fd + 1); in main()
556 if (vntsdp->timeout > 0) { in main()
560 vntsdp->tid = thr_self(); in main()
563 vntsd_get_config(vntsdp); in main()
569 poll_drv[0].fd = vntsdp->ctrl_fd; in main()
575 vntsd_delete_cons(vntsdp); in main()
586 vntsd_daemon_wakeup(vntsdp); in main()
591 vntsd_delete_cons(vntsdp); in main()
603 return (vntsdp->ip_addr); in vntsd_ip_addr()
629 if (ioctl(vntsdp->ctrl_fd, ioctl_code, (caddr_t)buf)) { in vntsd_vcc_ioctl()
676 (void) thr_kill(vntsdp->tid, SIGUSR1); in vntsd_vcc_err()