summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/rtems/rtems_bootp.c
blob: 8446d6ade9b3d6ef0bdddaf35735f5206c99f8a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <machine/rtems-bsd-kernel-space.h>

#if HAVE_CONFIG_H
#include "config.h"
#endif

#include <rtems.h>
#include <rtems/error.h>
#include <sys/types.h>
#include <rtems/rtems_bsdnet.h>
#include <rtems/rtems_bsdnet_internal.h>

#include "rtems/bootp.h"

/*
 * Perform a BOOTP request
 */
void
rtems_bsdnet_do_bootp (void)
{
  bool ok;
	rtems_bsdnet_semaphore_obtain ();
	ok = bootpc_init (false, true);
	rtems_bsdnet_semaphore_release ();
  if (!ok)
    panic ("rtems_bsdnet_do_bootp: bootp failed");
}

/*
 * Perform a BOOTP request and update "standard" files in /etc
 * with the results.
 */
void
rtems_bsdnet_do_bootp_and_rootfs (void)
{
  bool ok;
	rtems_bsdnet_semaphore_obtain ();
	ok = bootpc_init (true, true);
	rtems_bsdnet_semaphore_release ();
  if (!ok)
    panic ("rtems_bsdnet_do_bootp_and_rootfs: bootp failed");
}