servxcheck.c File Reference

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
#include <sys/ioctl.h>
#include <net/hton.h>
#include <net/gen/in.h>
#include <net/gen/tcp.h>
#include <net/gen/tcp_io.h>
#include <net/gen/inet.h>
#include <net/gen/socket.h>
#include <net/gen/netdb.h>

Include dependency graph for servxcheck.c:

Go to the source code of this file.

Defines

#define nil   0
#define ioctl   _ioctl
#define open   _open
#define write   _write
#define close   _close
#define WLEN   256
#define lc(c, d)   ((((c)= (d)) - 'A') <= ('Z' - 'A') ? (c)+= ('a' - 'A') : 0)
#define DEFFAIL   0x01
#define FAIL   (0x02 | DEFFAIL)
#define PASS   0x04

Functions

static int getword (FILE *fp, char *word)
static int netspec (char *word, ipaddr_t *addr, ipaddr_t *mask)
static int match (const char *word, const char *pattern)
static int get_name (ipaddr_t addr, char *name)
int servxcheck (ipaddr_t peer, const char *service, void(*logf)(int pass, const char *name))
char * servxfile (const char *file)

Variables

static const char * path_servacces = _PATH_SERVACCES


Define Documentation

#define close   _close
 

Definition at line 8 of file servxcheck.c.

Referenced by _res_close(), _tcp_accept(), _udp_socket(), add(), add_close(), adjust_boundary(), allowed(), apply_add(), ar_close(), ar_open(), ar_start_gzip(), asciisize(), bakcopy(), bclose(), cachedhcp(), cgiexec(), clearredir(), cloexec_test(), close1(), close_alot(), close_relay(), closeall(), closedir(), closef(), closefd(), closelog(), closepipe(), closescript(), cls(), cmd_errlist(), cmd_make(), cmd_mkexrc(), cmd_read(), cmd_tag(), commitpool(), connect(), copy(), copyfd(), copylink(), copystat(), cr_file(), crash_check(), crc(), crypt(), cutswitch(), daemonize(), daemonloop(), DataConnect(), deathtrap(), devclose(), df(), diocntl(), directory(), do_autopart(), do_child(), do_exec(), do_parent(), do_writefile(), doall(), DOappe(), DOclose(), DOdata(), doexrc(), doit(), DOlist(), DOMretr(), DOMstor(), DOnlst(), DOopen(), doPASV(), doPORT(), DOretr(), DOrretr(), DOrstor(), DOstor(), DOstou(), DoTalk(), dump_core(), dump_file(), dup2(), endfdxcmd(), endgrent(), endpwent(), endttyent(), evalbackcmd(), evalpipe(), exec_one(), execute(), extract(), f_pshinf(), fdxcmd(), ffork(), file(), file_close(), File_Device(), file_free(), fill_iftab(), filter(), Find_Deleted_Entry(), find_exist(), find_user(), findpool(), finduser(), fopen_output_safely(), forkexec(), forkshell(), fsversion(), ftpget(), fwclose(), geometry(), getfp(), getgeom(), gethostname(), getpass(), getpwd(), gnu_load(), grave(), gunzip(), gzlog_open(), gztack(), haunt(), herechar(), herein(), httpget(), IF(), init(), init_config(), initialize(), ins_file(), iosetup(), iwritfile(), job_connect(), link_islink(), listen(), load_file(), load_from_file(), load_mtab(), lock(), log_clean(), logmsg(), m_in(), m_out(), m_read(), m_shell(), main(), make_dir(), makenode(), mkfiles(), modtime(), my_getcwd(), needsprep(), NetInit(), NETinit(), nextdevice(), nm(), open_archive(), opendir(), openhere(), openpty(), openredirect(), opentemp(), pathconf(), plan_a(), popfile(), popredir(), preserve(), printdata(), processrequest(), proxy(), PT(), put_line(), quitenv(), rcmd(), rd_close(), rdfile_close(), read_info(), read_line(), read_settings(), readcutblk(), readpool(), recvfile(), regular(), release(), remap(), rewrite_mtab(), rpclose(), rpipe(), run(), run_job(), rundiff(), runvec(), safePopenOut(), sanitycheck_failed(), save_to_file(), saveworld(), sbx_fcls(), sbx_tset(), send(), sendcodes(), sendfile(), sendreply(), servxcheck(), set_ipconf(), setinputfd(), setinputfile(), SH(), shell(), shellescape(), show_file(), SimpleFileOpen(), size(), sizeup(), slave(), special(), split(), spool(), startup(), string_file(), strip(), subr(), swapon(), syminit(), system(), talk(), tcp_connect(), tcpget(), terminate(), test11a(), test11d(), test16a(), test19a(), test19b(), test19c(), test19d(), test19e(), test19f(), test19g(), test20d(), test21a(), test21d(), test21f(), test21g(), test21k(), test21l(), test22a(), test24a(), test25b(), test25c(), test25d(), test25e(), test26a(), test26b(), test26c(), test27a(), test27b(), test29a(), test29b(), test2a(), test2b(), test30a(), test30b(), test30c(), test31a(), test32a(), test32b(), test33c(), test38a(), test38b(), test39a(), test39b(), test39d(), test39e(), test39f(), test39g(), test39h(), test39j(), test3d(), test5h(), test5i(), test6c(), test7a(), test7b(), test7c(), test7d(), test7e(), test7f(), test7g(), test7h(), test7i(), test7j(), test8a(), test8b(), tgetent(), tmpsave(), tmpstart(), touch(), try_close(), tty_init(), udp_conf(), uname(), unhoard(), unix_dir_loop(), visitfile(), wall(), WB(), write_log(), write_pid(), write_settings(), write_table(), writedata(), WT(), wtmp(), yank(), and zcopy().

#define DEFFAIL   0x01
 

Definition at line 154 of file servxcheck.c.

Referenced by servxcheck().

#define FAIL   (0x02 | DEFFAIL)
 

Definition at line 155 of file servxcheck.c.

#define ioctl   _ioctl
 

Definition at line 5 of file servxcheck.c.

Referenced by _tcp_accept(), _tcp_bind(), _tcp_connect(), _tcp_getsockopt(), _tcp_shutdown(), _udp_bind(), _udp_connect(), ar_open(), ar_rdsync(), ar_rev(), asyn_wait(), authenticate(), bind(), boot_readwrite(), close_relay(), connect(), daemonloop(), DataConnect(), diocntl(), do_control(), do_read(), do_set(), DOopen(), doPASV(), fill_iftab(), forkshell(), geometry(), get_ipconf(), get_phys(), getch(), getgeom(), getifaddrs(), GetNetInfo(), getpeername(), getsize(), getsockname(), getsockopt(), ini_terminal(), inittty(), install_master(), job_setup_connect(), job_setup_listen(), listen(), m_read(), main(), mode(), NetConnect(), netfinger(), NetInit(), NETinit(), NetListen(), open_ct_ok(), openlog(), purgeline(), raw_install(), rcmd(), rdwr_inputs(), rdwr_levels(), rdwr_outputs(), recvfrom(), resettty(), rl_ttyset(), sanitycheck_failed(), scsi_cmd(), sendbrk(), sendreply(), sendrequest(), sendto(), set_hostaddr(), set_ipconf(), set_mtu(), set_netmask(), set_winsize(), setsockopt(), setterm(), show_one(), showtop(), shutdown(), sizeup(), talk(), tape_inquire(), tcdrain(), tcflow(), tcflush(), tcgetattr(), tcp_connect(), tcp_dns_tell(), tcp_urg(), tcsendbreak(), tcsetattr(), ts_enter(), ts_exit(), ts_init(), ts_inp(), ts_winsize(), TTYinfo(), udp_conf(), user_interface(), waitforjob(), window(), xioctl(), and zsendfdata().

#define lc c,
d   )     ((((c)= (d)) - 'A') <= ('Z' - 'A') ? (c)+= ('a' - 'A') : 0)
 

#define nil   0
 

Definition at line 4 of file servxcheck.c.

#define open   _open
 

Definition at line 6 of file servxcheck.c.

Referenced by _tcp_accept(), _tcp_socket(), _udp_socket(), add(), add_open(), allowed(), apply_add(), ar_open(), asciisize(), ask(), bopen(), cachedhcp(), close1(), cmd_errlist(), cmd_read(), cmd_tag(), cmd_write(), connect(), copy(), copy_file(), copylink(), core_init(), crash_check(), daemonize(), daemonloop(), DataConnect(), devopen(), df(), diocntl(), directory(), do_child(), do_open(), do_writefile(), doall(), DOappe(), DOdata(), dodot(), doexrc(), DOlist(), DOMretr(), DOMstor(), DOnlst(), DOopen(), doPASV(), DOretr(), DOrretr(), DOrstor(), DOstor(), DOstou(), dump_core(), eat_dir(), eopen(), exec_one(), execute(), fdxcmd(), file(), file_creat(), File_Device(), file_init(), file_open(), fill_iftab(), filter(), Find_Deleted_Entry(), find_exist(), find_user(), finduser(), fopen_output_safely(), forkshell(), format_device(), fsversion(), fwopen(), geometry(), get_block_size(), get_pty(), getboot(), getfp(), getgeom(), gethostname(), getifaddrs(), getpass(), globname(), gnu_load(), gunzip(), gzlog_open(), gzscan(), gztack(), haunt(), herein(), hoard(), IF(), init_config(), initialize(), ins_file(), install_master(), iosetup(), isbackup(), iwritfile(), job_setup_connect(), job_setup_listen(), listen(), load_file(), load_from_file(), load_mtab(), lock_device(), logmsg(), m_read(), main(), make_bootable(), merge(), mkfiles(), modtime(), move_file(), my_getcwd(), needsprep(), netfinger(), NetInit(), NETinit(), newfile(), nm(), open_alot(), open_archive(), open_device(), opendir(), openlog(), openpool(), openpty(), openredirect(), opentab(), opentemp(), opentty(), pathconf(), peek(), plan_a(), poke(), police(), preserve(), printdata(), procfile(), rcmd(), read_conf(), read_profile(), read_settings(), readcmdfile(), readcutblk(), readfs(), recvfile(), regular(), runvec(), sanitycheck_failed(), save_to_file(), saveworld(), sbx_tset(), scratch_file(), scsi_open(), second(), sendcodes(), servxcheck(), set_ipconf(), setgrent(), setinputfile(), setpwent(), settty(), setttyent(), SH(), show_file(), simple(), SimpleFileOpen(), size(), sizeup(), slave(), source(), special(), spool(), startup(), strip(), subr(), swapon(), syminit(), tcp_connect(), test03(), test04(), test05(), test06(), test10(), test11a(), test16a(), test19a(), test19b(), test19c(), test19d(), test19e(), test19g(), test20d(), test21a(), test22a(), test25b(), test25c(), test25d(), test25e(), test26a(), test26b(), test26c(), test27a(), test27b(), test29a(), test29b(), test30a(), test31a(), test32a(), test38a(), test38b(), test39e(), test6c(), test7b(), test7d(), test7e(), test7f(), test7g(), test7h(), test7i(), test7j(), test8b(), tgetent(), tmpsave(), tmpstart(), touch(), try_open(), tty_init(), udp_conf(), uname(), unix_dir_loop(), visitfile(), wall(), wr_archive(), write_log(), write_table(), writedata(), wtmp(), and zcopy().

#define PASS   0x04
 

Definition at line 156 of file servxcheck.c.

Referenced by servxcheck().

#define WLEN   256
 

Definition at line 29 of file servxcheck.c.

Referenced by servxcheck().

#define write   _write
 

Definition at line 7 of file servxcheck.c.

Referenced by _udp_sendto(), add(), add_dir(), alloc(), apply_add(), ar_write(), asciirecv(), asciisend(), ask(), asyn_wait(), bakcopy(), beforedo(), binaryrecv(), binarysend(), blkflush(), boot_readwrite(), bwrite(), cachedhcp(), check_file(), chk_ftime(), convert(), copy(), copy_data(), copy_file(), copylink(), copytab(), cp_file(), cr_file(), crypt(), daemonize(), daemonloop(), devio(), die(), disk_io(), do_getty(), do_parent(), done(), DoTalk(), dump_core(), dump_file(), echo(), error(), escape(), execute(), fatal(), file_flush(), file_write(), flush(), flush_buffer(), fprintf(), fprintlog(), ftpget(), get_pty(), getpass(), getsize(), gzlog_close(), gzlog_open(), gzlog_write(), gzscan(), gztack(), herein(), httpget(), inflate_fast(), inflateBack9(), initscr(), interrupt(), intr(), ioecho(), keep_reading(), list(), m_assert(), main(), makepathtables(), move_file(), musthave(), mwrite(), myputc(), named_probe(), netfinger(), order(), out(), panic(), plan_b(), poke(), print(), proxy(), prs(), put_block(), putboot(), putc(), putchar(), putk(), puto(), putpipe(), putvlist(), rarp_reply(), rcmd(), reader(), recomp(), recvfile(), report(), respond_really(), response(), rewrite_mtab(), rsource(), run(), run_job(), rw_inode(), rw_super(), save_to_file(), savedigs(), say(), sayhello(), sbx_aout(), send(), sendcodes(), sendfile(), sendline(), sendout(), sendreply(), sendrequest(), sendsig(), servxcheck(), set_bit(), setstat(), show_file(), sink(), split(), spool(), starttcap(), startup(), std_err(), std_out(), storename(), stunalloc(), sys_write(), syslog(), talk(), tbufls(), tcpget(), tcpip_writeall(), tel_in(), tel_out(), tell(), telopt(), term_inout(), test03(), test04(), test06(), test10(), test11(), test11a(), test16a(), test19b(), test19d(), test19e(), test19f(), test19g(), test21a(), test25b(), test25c(), test26a(), test26b(), test27a(), test2a(), test2b(), test30a(), test31a(), test32a(), test38a(), test38b(), test39e(), test7a(), test7b(), test7d(), test7e(), test7f(), test7g(), test7h(), test7i(), test7j(), test8a(), test8b(), time_functions(), Time_out(), tmpstart(), touch(), TTYflush(), varput(), wall(), WB(), wr_bytes(), Write(), write_block(), write_header(), write_log(), write_pid(), write_settings(), write_standards(), write_table(), write_wave_header(), Write_Word(), writeall(), writeblock(), writepool(), writetty(), writev(), writez(), wrt_fd(), wtmp(), and xwrite().


Function Documentation

static int get_name ipaddr_t  addr,
char *  name
[static]
 

Definition at line 126 of file servxcheck.c.

References AF_INET, gethostbyaddr, gethostbyname, hostent::h_addr_list, hostent::h_addrtype, hostent::h_name, i, memcmp(), NULL, and strcpy().

static int getword FILE fp,
char *  word
[static]
 

Definition at line 31 of file servxcheck.c.

References c, EOF, fp, getc, and wc.

static int match const char *  word,
const char *  pattern
[static]
 

Definition at line 91 of file servxcheck.c.

References cp, lc, and match.

static int netspec char *  word,
ipaddr_t addr,
ipaddr_t mask
[static]
 

Definition at line 65 of file servxcheck.c.

References htonl, inet_aton(), L, NULL, r, S32, slash(), and strchr.

Referenced by servxcheck().

int servxcheck ipaddr_t  peer,
const char *  service,
void(*)(int pass, const char *name logf
 

Definition at line 158 of file servxcheck.c.

References addr, c, close, DEFFAIL, ENOENT, EOF, errno, FAIL, fclose(), fopen(), fp, fprintf(), get_name(), getword(), HTONL, localtime(), log(), match, month, netspec(), nil, O_APPEND, O_WRONLY, open, PASS, path_servacces, sprintf(), stderr, strcmp, strlen(), t, time, time_t, tm::tm_hour, tm::tm_mday, tm::tm_min, tm::tm_mon, tm::tm_sec, WLEN, and write.

Referenced by main().

char* servxfile const char *  file  ) 
 

Definition at line 294 of file servxcheck.c.

References path_servacces.


Variable Documentation

const char* path_servacces = _PATH_SERVACCES [static]
 

Definition at line 27 of file servxcheck.c.

Referenced by servxcheck(), and servxfile().


Generated on Fri Apr 14 23:17:03 2006 for minix by  doxygen 1.4.6