Update of /cvsroot/dhcp-agent/dhcp-agent
In directory usw-pr-cvs1:/tmp/cvs-serv8152
Modified Files:
dhcp-util.c
Log Message:
added is_seven_bit_clean; fixed messaging :|
Index: dhcp-util.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-util.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** dhcp-util.c 2 Jul 2002 16:45:37 -0000 1.22
--- dhcp-util.c 2 Jul 2002 17:09:15 -0000 1.23
***************
*** 29,33 ****
static char msgbuff[MSG_BUFFER_SIZE];
! static int verbosity_level = WARNING_VERBOSITY_LEVEL;
/* set the verbosity level. */
--- 29,33 ----
static char msgbuff[MSG_BUFFER_SIZE];
! static int verbosity_level = MAX_VERBOSITY_LEVEL;
/* set the verbosity level. */
***************
*** 137,146 ****
va_list ap;
! if(verbosity_level >= NORMAL_VERBOSITY_LEVEL)
return;
va_start(ap, fmt);
! message_proc("fatal error", fmt, ap);
va_end(ap);
--- 137,146 ----
va_list ap;
! if(get_verbosity_level() <= NORMAL_VERBOSITY_LEVEL)
return;
va_start(ap, fmt);
! message_proc("info", fmt, ap);
va_end(ap);
***************
*** 154,158 ****
va_list ap;
! if(get_verbosity_level() >= WARNING_VERBOSITY_LEVEL)
return;
--- 154,158 ----
va_list ap;
! if(get_verbosity_level() <= WARNING_VERBOSITY_LEVEL)
return;
***************
*** 172,176 ****
va_list ap;
! if(get_verbosity_level() >= DEBUG_VERBOSITY_LEVEL)
return;
--- 172,176 ----
va_list ap;
! if(get_verbosity_level() <= DEBUG_VERBOSITY_LEVEL)
return;
***************
*** 590,624 ****
}
! /* sigio handling routine and variable.
! * we only need to use this on *BSD
! * with broken BPF which can't handle a select(). */
!
! /* wrap for volatine integers, or proper sig_atomic_t types. */
!
! #ifdef HAVE_SIG_ATOMIC_T
!
! static sig_atomic_t have_io = 0;
!
! #else /* HAVE_SIG_ATOMIC_T */
!
! static volatile int have_io = 0;
!
! #endif
!
! static RETSIGTYPE handle_sigio(int i)
{
! have_io = 1;
! }
! void track_sigio(void)
! {
! have_io = 0;
! add_interrupt_handler(SIGIO, handle_sigio);
! return;
! }
! int had_io(void)
! {
! return have_io;
}
--- 590,604 ----
}
! int is_seven_bit_clean(const char *data, int len)
{
! int i;
! const unsigned char *ptr = data;
! for(i = 0;i < len;i++) {
! if(ptr[i] >= 128)
! return 0;
! }
! return 1;
}
|