/* ndbootd.h - header file for the Sun Network Disk (nd) daemon: */
/*
* Copyright (c) 2001 Matthew Fredette. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Matthew Fredette.
* 4. The name of Matthew Fredette may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* the socket for the interface: */
int ndbootd_interface_fd;
/* private data for the raw interface: */
void *_ndbootd_interface_raw_private;
};
/* the Sun Network Disk (nd) packet format: */
struct ndboot_packet {
/* the operation code: */
u_int8_t ndboot_packet_op;
/* the minor device: */
u_int8_t ndboot_packet_minor;
/* any error: */
int8_t ndboot_packet_error;
/* the disk version number: */
int8_t ndboot_packet_disk_version;
/* the sequence number: */
int32_t ndboot_packet_sequence;
/* the disk block number: */
int32_t ndboot_packet_block_number;
/* the byte count: */
int32_t ndboot_packet_byte_count;
/* the residual byte count: */
int32_t ndboot_packet_residual_byte_count;
/* the current byte offset: */
int32_t ndboot_packet_current_byte_offset;
/* the current byte count: */
int32_t ndboot_packet_current_byte_count;
};
/* prototypes: */
int ndbootd_raw_open _NDBOOTD_P((struct ndbootd_interface *));
int ndbootd_raw_read _NDBOOTD_P((struct ndbootd_interface *, void *, size_t));
int ndbootd_raw_write _NDBOOTD_P((struct ndbootd_interface *, void *, size_t));