summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/rtems/mkrootfs.h
blob: 18cd12df3e56ba3cb998fa8a6e9dd8884f5006b9 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
 * @file rtems/mkrootfs.h
 *
 * RTEMS Root FS creation support.
 */

/*
  Copyright Cybertec Pty Ltd, 2000
  All rights reserved Cybertec Pty Ltd, 2000

  COPYRIGHT (c) 1989-1998.
  On-Line Applications Research Corporation (OAR).

  The license and distribution terms for this file may be
  found in the file LICENSE in this distribution or at
  http://www.rtems.com/license/LICENSE.

  This software with is provided ``as is'' and with NO WARRANTY.
*/

#ifndef _RTEMS_MKROOTFS_H
#define _RTEMS_MKROOTFS_H

#include <arpa/inet.h> /* in_addr_t */

#include <rtems.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 *  Appends the lines to the a file. Create the file
 *  and builds the path if it does not exist.
 *
 *  @param file
 *  @param omode
 *  @param line_cnt
 *  @param lines
 * 
 *  @return 0 on success, -1 on error
 */

int
rtems_rootfs_file_append (const char *file,
                          mode_t     omode,
                          const int  line_cnt,
                          const char **lines);

/**
 *  @brief Helper for bulding an /etc/hosts file.
 *
 *  @param cip
 *  @param cname
 *  @param dname
 *
 *  @return 0 on success, -1 on error
 */

int
rtems_rootfs_append_host_rec (in_addr_t cip,
                              const char    *cname,
                              const char    *dname);

/**
 * Create a few common directories, plus a:
 * /etc/passwd, /etc/group, /etc/host.conf, and
 * /etc/hosts file.
 *
 * @return 0 on success, -1 on error
 */

int
rtems_create_root_fs ( void );

#ifdef __cplusplus
}
#endif

#endif