xref: /freebsd/sbin/dhclient/tests/fake.c (revision c697fb7f)
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(const char *fmt, ...)
13 {
14 	va_list ap;
15 
16 	va_start(ap, fmt);
17 	(void)vfprintf(stderr, fmt, ap);
18 	va_end(ap);
19 	fprintf(stderr, "\n");
20 
21 	longjmp(env, 1);
22 }
23 
24 int
25 warning(const char *fmt, ...)
26 {
27 	va_list ap;
28 
29 	va_start(ap, fmt);
30 	(void)vfprintf(stderr, fmt, ap);
31 	va_end(ap);
32 	fprintf(stderr, "\n");
33 
34 	/*
35 	 * The original warning() would return "ret" here. We do this to
36 	 * check warnings explicitely.
37 	 */
38 	longjmp(env, 1);
39 }
40 
41 int
42 note(const char *fmt, ...)
43 {
44 	int ret;
45 	va_list ap;
46 
47 	va_start(ap, fmt);
48 	ret = vfprintf(stderr, fmt, ap);
49 	va_end(ap);
50 	fprintf(stderr, "\n");
51 
52 	return ret;
53 }
54 
55 void
56 bootp(struct packet *packet)
57 {
58 }
59 
60 void
61 dhcp(struct packet *packet)
62 {
63 }
64