/*

                                   _JNJ`                        
                               .JNMH`                           
                              JMMF`       `;.                   
                            .NMM)          `MN.                 
                            MMM)            (MML                
                           (MMM`             MMML               
                     M  I  D  N  I  G  H  T    C  o  D  E       
                           (NMMF             MHNH               
                            NMML            .MMM                
                             NMML          .NMH                 
                              4MMNL       .#F                   
                               `4HNNL_   `                      
                                   `"""`                        

                          Copyright (C) 2004-2007
       "Ian (Larry) Latter" <ian dot latter at midnightcode dot org>

    Midnight Code is a registered trademark of Ian Latter.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, and mirrored at the Midnight Code web
    site; as at version 2 of the License only.
  
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
  
    You should have received a copy of the GNU General Public License
    (version 2) along with this program; if not, write to the Free
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA, or see http://midnightcode.org/gplv2.txt

*/


/* midnightcode-init.h :: Midnight Code init assister library		*/


#ifndef __MIDNIGHTCODE_INIT_H
#define __MIDNIGHTCODE_INIT_H 1


enum midnightcode_init_hardware_t
{
  MIDNIGHTCODE_INIT_HARDWARE_NONE = 0,
  MIDNIGHTCODE_INIT_HARDWARE_DISK = 1,
  MIDNIGHTCODE_INIT_HARDWARE_INTERFACE = 2,
  MIDNIGHTCODE_INIT_HARDWARE_CAMERA = 4
};

enum midnightcode_init_config_t
{
  MIDNIGHTCODE_INIT_CONFIG_NONE = 0,
  MIDNIGHTCODE_INIT_CONFIG_DISK = 1,
  MIDNIGHTCODE_INIT_CONFIG_INTERFACE = 2,
  MIDNIGHTCODE_INIT_CONFIG_ROUTE = 4,
  MIDNIGHTCODE_INIT_CONFIG_RESOLVE = 8
};

enum midnightcode_init_fs_t
{
  MIDNIGHTCODE_INIT_FS_NONE = 0,
  MIDNIGHTCODE_INIT_FS_PROC = 1,
  MIDNIGHTCODE_INIT_FS_SYS = 2,
  MIDNIGHTCODE_INIT_FS_PTS = 4,
  MIDNIGHTCODE_INIT_FS_DEV = 8
};

enum midnightcode_init_boot_t
{
  MIDNIGHTCODE_INIT_BOOT_SOFT = 0,
  MIDNIGHTCODE_INIT_BOOT_HARD = (int)(0x89ABCDEF),
  MIDNIGHTCODE_INIT_BOOT_REBOOT = 0x01234567,
  MIDNIGHTCODE_INIT_BOOT_HALT = (int)(0xCDEF0123),
  MIDNIGHTCODE_INIT_BOOT_POWEROFF = 0x4321FEDC
};

enum midnightcode_init_runlevel_t
{
  MIDNIGHTCODE_INIT_RUNLEVEL_HALT = 0,
  MIDNIGHTCODE_INIT_RUNLEVEL_REPAIR = 1,
  MIDNIGHTCODE_INIT_RUNLEVEL_NONET = 2,
  MIDNIGHTCODE_INIT_RUNLEVEL_FULL = 3,
  MIDNIGHTCODE_INIT_RUNLEVEL_VOID = 4,
  MIDNIGHTCODE_INIT_RUNLEVEL_GUI = 5,
  MIDNIGHTCODE_INIT_RUNLEVEL_RESTART = 6
};

enum midnightcode_init_bootdev_t
{
  MIDNIGHTCODE_INIT_BOOTDEV_UNKNOWN = 0,
  MIDNIGHTCODE_INIT_BOOTDEV_USB = 1,
  MIDNIGHTCODE_INIT_BOOTDEV_PXE = 2,
  MIDNIGHTCODE_INIT_BOOTDEV_DISC = 3,
  MIDNIGHTCODE_INIT_BOOTDEV_DISK = 4
};


int midnightcode_init_process(char * label, char * process, int options,
              int terminal);
int midnightcode_init_sysctl(char * label, char * control, char * value);
int midnightcode_init_config_load(char * config_file,
              struct midnightcode_config_head_t * elements,
              int default_state);
int midnightcode_init_config_retrieve(
              struct midnightcode_disk_head_t * disk_list_head_p,
              struct midnightcode_interface_head_t * interface_list_head_p,
              struct midnightcode_route_head_t * route_list_head_p,
              struct midnightcode_resolve_domain_head_t * domain_list_head_p,
              struct midnightcode_resolve_server_head_t * server_list_head_p,
              struct midnightcode_config_head_t * config_list_head_p);
int midnightcode_init_hardware(
              struct midnightcode_disk_head_t * disk_list_head_p,
              struct midnightcode_interface_head_t * interface_list_head_p);
int midnightcode_init_peripherals(
              struct midnightcode_camera_head_t * camera_list_head_p);
int midnightcode_init_networking(
              struct midnightcode_interface_head_t * elements,
              struct midnightcode_interface_element_t ** element);
int midnightcode_init_mountfs(int options);
int midnightcode_init_nic_lo(
              struct midnightcode_interface_head_t * interface_list_head_p);
int midnightcode_init_usbmedia(
              struct midnightcode_disk_head_t ** elements, char * label,
              struct midnightcode_disk_element_t ** element, int sleep_cycle);
int midnightcode_init_cdmedia(
              struct midnightcode_disk_head_t * elements, char * label,
              struct midnightcode_disk_element_t ** element);
int midnightcode_init_boot(int token);


#endif
