BFS(5spp)
NAME
bfs − description of the boot file server protocol
SYNOPSIS
#include <saio/bfs.h>
DESCRIPTION
The bfs protocol is spoken between the bfs protocol module of the standalone library and the UMIPS-BSD program bfsd(8). The bfs protocol allows standalone programs to read files across an ethernet from a host UMIPS-BSD system. The bfs protocol is layer on top of the UDP, IP, and ARP protocols and relies upon them for establishing datagram service with the bfsd server.
The format of a bfs packet header is:
struct bfshdr {
charbh_rev;/* protocol revision */
charbh_type;/* packet type */
u_short bh_pathlen;/* pathname length */
shortbh_datalen;/* data length */
shortbh_pad;/* pad to int boundry */
u_intbh_offset;/* file offset */
intbh_flags;/* open flags to use */
charbh_server[BFS_MAXSERVER+1]; /* server */
};
A bfs packet consists of a bfs packet header followed by a null-terminated UNIX file pathname followed by data. The bfs header fields have the following uses:
bh_rev
Defines a protocol revision level, currently on revision level 1 is supported.
bh_type
Indicates the type of packet. Packet types are described below.
bh_pathlen
Indicates the length in bytes of the UNIX file pathname which follows immediately after the bfs header.
bh_datalen
Indicates the length in bytes of the data which follows immediately after the pathname.
bh_pad
Two bytes of fill to maintain data alignment requirements of the R2000. The contents is always ignored by bfs protocol participants.
bh_offset
The file offset for data transfer requests.
bh_flags
Flag indicating if the file is to be opened for reading (0), writing (1), or both (2).
bh_server
Filled in by the server to indicate to the standalone program the host satisfying the request.
The following bfs packet types are defined:
BFSPT_ENQUIRE
An enquire packet is broadcast by the standalone system to determine systems which can serve the file indicated by the UNIX pathname after the bfs header. The pathname may be preceeded by a hostname and a colon to restrict the request to a single host. The bh_flags indicates read/write intentions. Currently, writing files via bfs is not supported. The bh_pathlen field indicates the length of the pathname. The bh_datalen, bh_offset, and bh_server fields are undefined.
BFSPT_ENQRPY
Sent by a bfsd in reply to an BFSPT_ENQUIRE packet if the bfsd can serve the file. The bh_pathlen and UNIX pathname are returned identically to the request. The bh_server field is filled with the name of the host on which bfsd is running.
BFSPT_READ
Sent by a standalone program to an appropriate bfsd server determined by enquiry. The BFSPT_READ packet maintains the UNIX pathname of the file to be served after the bfs packet header and has the length of the pathname in the bh_pathlen field. The bh_offset field indicates the offset into the file at which the data transfer should begin. The bh_datalen field indicates the amount of desired. The data length must be less than or equal to 1024 bytes.
BFSPT_RDRPY
Sent by a bfsd server in response to a BFSPT_READ packet. The BFSPT_RDRPY packet maintains the UNIX pathname of the file to be served after the bfs packet header and has the length of the pathname in the bh_pathlen field. The bh_offset field indicates the offset into the file at which the data transfer began. The bh_datalen field indicates the amount of data actually in the packet. The data length must be less than or equal to 1024 bytes. The bh_datalen field may be less than the amount requested in the BFSPT_READ packet. A bh_datalen of zero indicates end of file; a bh_datalen of -1 indicates an error on attempting to read the requested data.
BFSPT_ERROR
A BFSPT_ERROR packet may be sent by a bfsd server to indicate the nature of an error in attempting to respond to a BFSPT_READ request. It should be followed by a BFSPT_RDRPY packet with a data length of -1. The BFSPT_ERROR should maint maintain the UNIX pathname of the file to being served after the bfs packet header and have the length of the pathname in the bh_pathlen field. The error message to be sent to the standalone program should appear after the pathname and be null-terminated. The length of the error message should be assigned to the bh_datalen field.