File:  [ELWIX - Embedded LightWeight unIX -] / ansh / inc / defs.h
Revision 1.1.1.1.2.1: download - view: text, annotated - select for diffs - revision graph
Fri Oct 7 13:41:26 2011 UTC (12 years, 9 months ago) by misho
Branches: ansh1_0
Diff to: branchpoint 1.1.1.1: preferred, unified
finish icmp service!!!

    1: /*************************************************************************
    2:  * (C) 2011 AITNET - Sofia/Bulgaria - <office@aitnet.org>
    3:  *  by Michael Pounov <misho@elwix.org>
    4:  *
    5:  * $Author: misho $
    6:  * $Id: defs.h,v 1.1.1.1.2.1 2011/10/07 13:41:26 misho Exp $
    7:  *
    8:  *************************************************************************/
    9: #ifndef __DEFS_H
   10: #define __DEFS_H
   11: 
   12: 
   13: #define STRSIZ		256
   14: #define PIDFILE_ANSHD	"/var/run/anshd.pid"
   15: #define PIDFILE_ANSH3D	"/var/run/ansh3d.pid"
   16: 
   17: #define VERB(x)		if ((x) <= Verbose)
   18: #define FTRACE(x)	if ((x) <= Verbose) syslog(LOG_DEBUG, "Debug:: I`m in %s(%d) ...\n", __func__, __LINE__)
   19: #define LOG(fmt, ...)	do { assert((fmt)); \
   20: 					char sz_log_fmt[STRSIZ] = { 0 }; \
   21: 					snprintf(sz_log_fmt, sizeof sz_log_fmt, (fmt), ##__VA_ARGS__); \
   22: 					syslog(LOG_DEBUG, "Log:: %s(%d) -> %s\n", __func__, __LINE__, sz_log_fmt); \
   23: 				} while (0)
   24: #define ERR(fmt, ...)	do { assert((fmt)); \
   25: 					char sz_err_fmt[STRSIZ] = { 0 }; \
   26: 					snprintf(sz_err_fmt, sizeof sz_err_fmt, (fmt), ##__VA_ARGS__); \
   27: 					syslog(LOG_ERR, "Error:: %s(%d) -> %s\n", __func__, __LINE__, sz_err_fmt); \
   28: 				} while (0)
   29: 
   30: struct tagProc {
   31: 	u_short			proc_id;
   32: 	u_short			proc_seq;
   33: 
   34: 	char			proc_flg;
   35: 
   36: 	int			proc_pty;
   37: 	char			proc_ttyname[64];
   38: 	pid_t			proc_pid;
   39: 
   40: 	int			proc_sock;
   41: 	struct sockaddr		proc_cli;
   42: 	struct ether_addr	proc_ea;
   43: 
   44: 	u_short			proc_blen;
   45: 	u_char			*proc_buf_[2];
   46: 	u_short			proc_rlen_[2];
   47: #define NET2FD			0
   48: #define FD2NET			1
   49: 
   50: 	SLIST_ENTRY(tagProc)	proc_next;
   51: };
   52: typedef SLIST_HEAD(, tagProc)	proc_head_t;
   53: 
   54: 
   55: extern intptr_t Kill;
   56: extern int Timeout, Verbose;
   57: extern u_int Crypted;
   58: 
   59: 
   60: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>