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 int warnings_occurred; 11 12 void 13 error(const char *fmt, ...) 14 { 15 va_list ap; 16 17 va_start(ap, fmt); 18 (void)vfprintf(stderr, fmt, ap); 19 va_end(ap); 20 fprintf(stderr, "\n"); 21 22 longjmp(env, 1); 23 } 24 25 int 26 warning(const char *fmt, ...) 27 { 28 va_list ap; 29 30 va_start(ap, fmt); 31 (void)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 explicitly. 38 */ 39 longjmp(env, 1); 40 } 41 42 int 43 note(const 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 int 57 parse_warn(const char *fmt, ...) 58 { 59 int ret; 60 va_list ap; 61 62 va_start(ap, fmt); 63 ret = vfprintf(stderr, fmt, ap); 64 va_end(ap); 65 fprintf(stderr, "\n"); 66 67 return ret; 68 } 69 70 void 71 bootp(struct packet *packet) 72 { 73 } 74 75 void 76 dhcp(struct packet *packet) 77 { 78 } 79