static void do_work(void) { char *curip = NULL; struct in_addr inr; log_line("updating to interface: [%s]", ifname); while (1) { free(curip); if (update_from_remote == 0) { curip = get_interface_ip(ifname); } else { curip = query_curip(); } if (!curip) goto sleep; if (inet_aton(curip, &inr) == 0) { log_line("%s has ip: [%s], which is invalid. Sleeping.", ifname, curip); goto sleep; } dd_work(curip); nc_work(curip); he_dns_work(curip); he_tun_work(curip); sleep: do_sleep(); } }
main() { int ret; long a = 0xffffffffffffffff; if (ret = kp_init()) { printf("ret %d\n", ret); } reader_init(); printf("a 0x%lx \n& 0x%lx\n s 0x%lx\n", a, TIME_STAMP_BYTES(a), TIME_STAMP_BYTES(a)<<TIME_SHIFT_ORDER); test_reader(); // work dd_work(); // read // exit dd_exit(); }