1 /* $FreeBSD$ */ 2 3 #include <setjmp.h> 4 #include <stdarg.h> 5 #include <stdio.h> 6 7 #include "dhcpd.h" 8 9 extern jmp_buf env; 10 11 void 12 error(char *fmt, ...) 13 { 14 va_list ap; 15 16 va_start(ap, fmt); 17 vfprintf(stderr, fmt, ap); 18 va_end(ap); 19 fprintf(stderr, "\n"); 20 21 longjmp(env, 1); 22 } 23 24 int 25 warning(char *fmt, ...) 26 { 27 int ret; 28 va_list ap; 29 30 va_start(ap, fmt); 31 ret = vfprintf(stderr, fmt, ap); 32 va_end(ap); 33 fprintf(stderr, "\n"); 34 35 /* 36 * The original warning() would return "ret" here. We do this to 37 * check warnings explicitely. 38 */ 39 longjmp(env, 1); 40 } 41 42 int 43 note(char *fmt, ...) 44 { 45 int ret; 46 va_list ap; 47 48 va_start(ap, fmt); 49 ret = vfprintf(stderr, fmt, ap); 50 va_end(ap); 51 fprintf(stderr, "\n"); 52 53 return ret; 54 } 55 56 void 57 bootp(struct packet *packet) 58 { 59 } 60 61 void 62 dhcp(struct packet *packet) 63 { 64 } 65