1c68de748SJulio Merino
2c68de748SJulio Merino #include <setjmp.h>
3c68de748SJulio Merino #include <stdarg.h>
4c68de748SJulio Merino #include <stdio.h>
5c68de748SJulio Merino
6c68de748SJulio Merino #include "dhcpd.h"
7c68de748SJulio Merino
8c68de748SJulio Merino extern jmp_buf env;
9*c210cac0SAlex Bahm int warnings_occurred;
10c68de748SJulio Merino
11c68de748SJulio Merino void
error(const char * fmt,...)1279a1d195SAlan Somers error(const char *fmt, ...)
13c68de748SJulio Merino {
14c68de748SJulio Merino va_list ap;
15c68de748SJulio Merino
16c68de748SJulio Merino va_start(ap, fmt);
17513bdaa1SEnji Cooper (void)vfprintf(stderr, fmt, ap);
18c68de748SJulio Merino va_end(ap);
19c68de748SJulio Merino fprintf(stderr, "\n");
20c68de748SJulio Merino
21c68de748SJulio Merino longjmp(env, 1);
22c68de748SJulio Merino }
23c68de748SJulio Merino
24c68de748SJulio Merino int
warning(const char * fmt,...)2579a1d195SAlan Somers warning(const char *fmt, ...)
26c68de748SJulio Merino {
27c68de748SJulio Merino va_list ap;
28c68de748SJulio Merino
29c68de748SJulio Merino va_start(ap, fmt);
30513bdaa1SEnji Cooper (void)vfprintf(stderr, fmt, ap);
31c68de748SJulio Merino va_end(ap);
32c68de748SJulio Merino fprintf(stderr, "\n");
33c68de748SJulio Merino
34c68de748SJulio Merino /*
35c68de748SJulio Merino * The original warning() would return "ret" here. We do this to
36a06052d6SGordon Bergling * check warnings explicitly.
37c68de748SJulio Merino */
38c68de748SJulio Merino longjmp(env, 1);
39c68de748SJulio Merino }
40c68de748SJulio Merino
41c68de748SJulio Merino int
note(const char * fmt,...)4279a1d195SAlan Somers note(const char *fmt, ...)
43c68de748SJulio Merino {
44c68de748SJulio Merino int ret;
45c68de748SJulio Merino va_list ap;
46c68de748SJulio Merino
47c68de748SJulio Merino va_start(ap, fmt);
48c68de748SJulio Merino ret = vfprintf(stderr, fmt, ap);
49c68de748SJulio Merino va_end(ap);
50c68de748SJulio Merino fprintf(stderr, "\n");
51c68de748SJulio Merino
52c68de748SJulio Merino return ret;
53c68de748SJulio Merino }
54c68de748SJulio Merino
55*c210cac0SAlex Bahm int
parse_warn(const char * fmt,...)56*c210cac0SAlex Bahm parse_warn(const char *fmt, ...)
57*c210cac0SAlex Bahm {
58*c210cac0SAlex Bahm int ret;
59*c210cac0SAlex Bahm va_list ap;
60*c210cac0SAlex Bahm
61*c210cac0SAlex Bahm va_start(ap, fmt);
62*c210cac0SAlex Bahm ret = vfprintf(stderr, fmt, ap);
63*c210cac0SAlex Bahm va_end(ap);
64*c210cac0SAlex Bahm fprintf(stderr, "\n");
65*c210cac0SAlex Bahm
66*c210cac0SAlex Bahm return ret;
67*c210cac0SAlex Bahm }
68*c210cac0SAlex Bahm
69c68de748SJulio Merino void
bootp(struct packet * packet)70c68de748SJulio Merino bootp(struct packet *packet)
71c68de748SJulio Merino {
72c68de748SJulio Merino }
73c68de748SJulio Merino
74c68de748SJulio Merino void
dhcp(struct packet * packet)75c68de748SJulio Merino dhcp(struct packet *packet)
76c68de748SJulio Merino {
77c68de748SJulio Merino }
78