retire PUBLIC, PRIVATE and FORWARD
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
/*****************************************************************************
|
||||
* do_bind_device *
|
||||
****************************************************************************/
|
||||
PUBLIC int do_bind_device(message *m)
|
||||
int do_bind_device(message *m)
|
||||
{
|
||||
struct devman_device *dev;
|
||||
int res;
|
||||
@@ -53,7 +53,7 @@ PUBLIC int do_bind_device(message *m)
|
||||
/*****************************************************************************
|
||||
* do_unbind_device *
|
||||
****************************************************************************/
|
||||
PUBLIC int do_unbind_device(message *m)
|
||||
int do_unbind_device(message *m)
|
||||
{
|
||||
struct devman_device *dev;
|
||||
int res;
|
||||
|
||||
@@ -42,16 +42,16 @@
|
||||
#include <string.h>
|
||||
#define BUF_SIZE 4096
|
||||
|
||||
PRIVATE char buf[BUF_SIZE + 1];
|
||||
PRIVATE size_t off, left, used;
|
||||
PRIVATE off_t skip;
|
||||
static char buf[BUF_SIZE + 1];
|
||||
static size_t off, left, used;
|
||||
static off_t skip;
|
||||
|
||||
#define MIN(x,y) (x<y?x:y)
|
||||
|
||||
/*===========================================================================*
|
||||
* buf_init *
|
||||
*===========================================================================*/
|
||||
PUBLIC void buf_init(off_t start, size_t len)
|
||||
void buf_init(off_t start, size_t len)
|
||||
{
|
||||
/* Initialize the buffer for fresh use. The first 'start' bytes of the
|
||||
* produced output are to be skipped. After that, up to a total of
|
||||
@@ -67,7 +67,7 @@ PUBLIC void buf_init(off_t start, size_t len)
|
||||
/*===========================================================================*
|
||||
* buf_printf *
|
||||
*===========================================================================*/
|
||||
PUBLIC void buf_printf(char *fmt, ...)
|
||||
void buf_printf(char *fmt, ...)
|
||||
{
|
||||
/* Add formatted text to the end of the buffer.
|
||||
*/
|
||||
@@ -123,7 +123,7 @@ PUBLIC void buf_printf(char *fmt, ...)
|
||||
/*===========================================================================*
|
||||
* buf_append *
|
||||
*===========================================================================*/
|
||||
PUBLIC void buf_append(char *data, size_t len)
|
||||
void buf_append(char *data, size_t len)
|
||||
{
|
||||
/* Add arbitrary data to the end of the buffer.
|
||||
*/
|
||||
@@ -155,7 +155,7 @@ PUBLIC void buf_append(char *data, size_t len)
|
||||
/*===========================================================================*
|
||||
* buf_get *
|
||||
*===========================================================================*/
|
||||
PUBLIC size_t buf_get(char **ptr)
|
||||
size_t buf_get(char **ptr)
|
||||
{
|
||||
/* Return the buffer's starting address and the length of the used
|
||||
* part, not counting the trailing null character for the latter.
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
#include "proto.h"
|
||||
|
||||
|
||||
FORWARD struct devman_device*devman_dev_add_child(struct devman_device
|
||||
static struct devman_device*devman_dev_add_child(struct devman_device
|
||||
*parent, struct devman_device_info *devinf);
|
||||
FORWARD struct devman_device *_find_dev(struct devman_device *dev, int
|
||||
static struct devman_device *_find_dev(struct devman_device *dev, int
|
||||
dev_id);
|
||||
FORWARD int devman_dev_add_info(struct devman_device *dev, struct
|
||||
static int devman_dev_add_info(struct devman_device *dev, struct
|
||||
devman_device_info_entry *entry, char *buf);
|
||||
FORWARD int devman_event_read(char **ptr, size_t *len,off_t offset, void
|
||||
static int devman_event_read(char **ptr, size_t *len,off_t offset, void
|
||||
*data);
|
||||
|
||||
FORWARD int devman_del_device(struct devman_device *dev);
|
||||
static int devman_del_device(struct devman_device *dev);
|
||||
|
||||
PRIVATE int next_device_id = 1;
|
||||
static int next_device_id = 1;
|
||||
|
||||
PRIVATE struct inode_stat default_dir_stat = {
|
||||
static struct inode_stat default_dir_stat = {
|
||||
/* .mode = */ S_IFDIR | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
/* .uid = */ 0,
|
||||
/* .gid = */ 0,
|
||||
@@ -23,7 +23,7 @@ PRIVATE struct inode_stat default_dir_stat = {
|
||||
/* .dev = */ NO_DEV,
|
||||
};
|
||||
|
||||
PRIVATE struct inode_stat default_file_stat = {
|
||||
static struct inode_stat default_file_stat = {
|
||||
/* .mode = */ S_IFREG | S_IRUSR | S_IRGRP | S_IROTH,
|
||||
/* .uid = */ 0,
|
||||
/* .gid = */ 0,
|
||||
@@ -32,16 +32,16 @@ PRIVATE struct inode_stat default_file_stat = {
|
||||
};
|
||||
|
||||
|
||||
PRIVATE struct devman_device root_dev;
|
||||
PRIVATE struct devman_event_inode event_inode_data = {
|
||||
static struct devman_device root_dev;
|
||||
static struct devman_event_inode event_inode_data = {
|
||||
TAILQ_HEAD_INITIALIZER(event_inode_data.event_queue),
|
||||
};
|
||||
PRIVATE struct devman_inode event_inode;
|
||||
static struct devman_inode event_inode;
|
||||
|
||||
/*===========================================================================*
|
||||
* devman_generate_path *
|
||||
*===========================================================================*/
|
||||
PRIVATE int
|
||||
static int
|
||||
devman_generate_path(char* buf, int len, struct devman_device *dev)
|
||||
{
|
||||
int res =0;
|
||||
@@ -71,7 +71,7 @@ devman_generate_path(char* buf, int len, struct devman_device *dev)
|
||||
/*===========================================================================*
|
||||
* devman_device_add_event *
|
||||
*===========================================================================*/
|
||||
PRIVATE void
|
||||
static void
|
||||
devman_device_add_event(struct devman_device* dev)
|
||||
{
|
||||
struct devman_event * event;
|
||||
@@ -103,7 +103,7 @@ devman_device_add_event(struct devman_device* dev)
|
||||
/*===========================================================================*
|
||||
* devman_device_remove_event *
|
||||
*===========================================================================*/
|
||||
PRIVATE void
|
||||
static void
|
||||
devman_device_remove_event(struct devman_device* dev)
|
||||
{
|
||||
struct devman_event * event;
|
||||
@@ -136,7 +136,7 @@ devman_device_remove_event(struct devman_device* dev)
|
||||
/*===========================================================================*
|
||||
* devman_event_read *
|
||||
*===========================================================================*/
|
||||
PRIVATE int
|
||||
static int
|
||||
devman_event_read(char **ptr, size_t *len,off_t offset, void *data)
|
||||
{
|
||||
struct devman_event *ev = NULL;
|
||||
@@ -173,7 +173,7 @@ devman_event_read(char **ptr, size_t *len,off_t offset, void *data)
|
||||
/*===========================================================================*
|
||||
* devman_static_info_read *
|
||||
*===========================================================================*/
|
||||
PRIVATE int
|
||||
static int
|
||||
devman_static_info_read(char **ptr, size_t *len, off_t offset, void *data)
|
||||
{
|
||||
struct devman_static_info_inode *n;
|
||||
@@ -189,7 +189,7 @@ devman_static_info_read(char **ptr, size_t *len, off_t offset, void *data)
|
||||
/*===========================================================================*
|
||||
* devman_init_devices *
|
||||
*===========================================================================*/
|
||||
PUBLIC void devman_init_devices()
|
||||
void devman_init_devices()
|
||||
{
|
||||
event_inode.data = &event_inode_data;
|
||||
event_inode.read_fn = devman_event_read;
|
||||
@@ -215,7 +215,7 @@ PUBLIC void devman_init_devices()
|
||||
/*===========================================================================*
|
||||
* do_reply *
|
||||
*===========================================================================*/
|
||||
PRIVATE void do_reply(message *msg, int res)
|
||||
static void do_reply(message *msg, int res)
|
||||
{
|
||||
msg->m_type = DEVMAN_REPLY;
|
||||
msg->DEVMAN_RESULT = res;
|
||||
@@ -225,7 +225,7 @@ PRIVATE void do_reply(message *msg, int res)
|
||||
/*===========================================================================*
|
||||
* do_add_device *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_add_device(message *msg)
|
||||
int do_add_device(message *msg)
|
||||
{
|
||||
endpoint_t ep = msg->m_source;
|
||||
int res;
|
||||
@@ -283,7 +283,7 @@ PUBLIC int do_add_device(message *msg)
|
||||
/*===========================================================================*
|
||||
* _find_dev *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct devman_device *
|
||||
static struct devman_device *
|
||||
_find_dev(struct devman_device *dev, int dev_id)
|
||||
{
|
||||
struct devman_device *_dev;
|
||||
@@ -306,7 +306,7 @@ _find_dev(struct devman_device *dev, int dev_id)
|
||||
/*===========================================================================*
|
||||
* devman_find_dev *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct devman_device *devman_find_device(int dev_id)
|
||||
struct devman_device *devman_find_device(int dev_id)
|
||||
{
|
||||
return _find_dev(&root_dev, dev_id);
|
||||
}
|
||||
@@ -314,7 +314,7 @@ PUBLIC struct devman_device *devman_find_device(int dev_id)
|
||||
/*===========================================================================*
|
||||
* devman_dev_add_static_info *
|
||||
*===========================================================================*/
|
||||
PRIVATE int
|
||||
static int
|
||||
devman_dev_add_static_info
|
||||
(struct devman_device *dev, char * name, char *data)
|
||||
{
|
||||
@@ -345,7 +345,7 @@ devman_dev_add_static_info
|
||||
/*===========================================================================*
|
||||
* devman_dev_add_child *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct devman_device*
|
||||
static struct devman_device*
|
||||
devman_dev_add_child
|
||||
(struct devman_device *parent, struct devman_device_info *devinf)
|
||||
{
|
||||
@@ -398,7 +398,7 @@ devman_dev_add_child
|
||||
/*===========================================================================*
|
||||
* devman_dev_add_info *
|
||||
*===========================================================================*/
|
||||
PRIVATE int
|
||||
static int
|
||||
devman_dev_add_info
|
||||
(struct devman_device *dev, struct devman_device_info_entry *entry, char *buf)
|
||||
{
|
||||
@@ -419,7 +419,7 @@ devman_dev_add_info
|
||||
/*===========================================================================*
|
||||
* do_del_device *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_del_device(message *msg)
|
||||
int do_del_device(message *msg)
|
||||
{
|
||||
int dev_id = msg->DEVMAN_DEVICE_ID;
|
||||
|
||||
@@ -455,7 +455,7 @@ PUBLIC int do_del_device(message *msg)
|
||||
/*===========================================================================*
|
||||
* devman_get_device *
|
||||
*===========================================================================*/
|
||||
PUBLIC void devman_get_device(struct devman_device *dev)
|
||||
void devman_get_device(struct devman_device *dev)
|
||||
{
|
||||
if (dev == NULL || dev == &root_dev) {
|
||||
return;
|
||||
@@ -466,7 +466,7 @@ PUBLIC void devman_get_device(struct devman_device *dev)
|
||||
/*===========================================================================*
|
||||
* devman_put_device *
|
||||
*===========================================================================*/
|
||||
PUBLIC void devman_put_device(struct devman_device *dev)
|
||||
void devman_put_device(struct devman_device *dev)
|
||||
{
|
||||
if (dev == NULL || dev == &root_dev ) {
|
||||
return;
|
||||
@@ -480,7 +480,7 @@ PUBLIC void devman_put_device(struct devman_device *dev)
|
||||
/*===========================================================================*
|
||||
* devman_del_device *
|
||||
*===========================================================================*/
|
||||
PRIVATE int devman_del_device(struct devman_device *dev)
|
||||
static int devman_del_device(struct devman_device *dev)
|
||||
{
|
||||
/* does device have children -> error */
|
||||
/* evtl. remove links */
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "devman.h"
|
||||
#include "proto.h"
|
||||
|
||||
PRIVATE void init_hook(void) {
|
||||
static void init_hook(void) {
|
||||
static int first = 1;
|
||||
|
||||
if (first) {
|
||||
@@ -45,7 +45,7 @@ PRIVATE void init_hook(void) {
|
||||
}
|
||||
|
||||
|
||||
PRIVATE int message_hook (message *m)
|
||||
static int message_hook (message *m)
|
||||
{
|
||||
switch (m->m_type) {
|
||||
case DEVMAN_ADD_DEV:
|
||||
@@ -60,7 +60,7 @@ PRIVATE int message_hook (message *m)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int
|
||||
static int
|
||||
read_hook
|
||||
(struct inode *inode, off_t offset, char **ptr, size_t *len, cbdata_t cbdata)
|
||||
{
|
||||
@@ -70,7 +70,7 @@ read_hook
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int main (int argc, char* argv[])
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
|
||||
struct fs_hooks hooks;
|
||||
|
||||
@@ -12,20 +12,20 @@
|
||||
#include <minix/endpoint.h>
|
||||
|
||||
/* Allocate space for the global variables. */
|
||||
PRIVATE endpoint_t who_e; /* caller's proc number */
|
||||
PRIVATE int callnr; /* system call number */
|
||||
static endpoint_t who_e; /* caller's proc number */
|
||||
static int callnr; /* system call number */
|
||||
|
||||
/* Declare some local functions. */
|
||||
FORWARD void get_work(message *m_ptr);
|
||||
FORWARD void reply(endpoint_t whom, message *m_ptr);
|
||||
static void get_work(message *m_ptr);
|
||||
static void reply(endpoint_t whom, message *m_ptr);
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
static void sef_local_startup(void);
|
||||
|
||||
/*===========================================================================*
|
||||
* main *
|
||||
*===========================================================================*/
|
||||
PUBLIC int main(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
/* This is the main routine of this service. The main loop consists of
|
||||
* three major activities: getting new work, processing the work, and
|
||||
@@ -93,7 +93,7 @@ send_reply:
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -108,7 +108,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* get_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void get_work(
|
||||
static void get_work(
|
||||
message *m_ptr /* message buffer */
|
||||
)
|
||||
{
|
||||
@@ -122,7 +122,7 @@ PRIVATE void get_work(
|
||||
/*===========================================================================*
|
||||
* reply *
|
||||
*===========================================================================*/
|
||||
PRIVATE void reply(
|
||||
static void reply(
|
||||
endpoint_t who_e, /* destination */
|
||||
message *m_ptr /* message buffer */
|
||||
)
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
#include "store.h"
|
||||
|
||||
/* Allocate space for the data store. */
|
||||
PRIVATE struct data_store ds_store[NR_DS_KEYS];
|
||||
PRIVATE struct subscription ds_subs[NR_DS_SUBS];
|
||||
static struct data_store ds_store[NR_DS_KEYS];
|
||||
static struct subscription ds_subs[NR_DS_SUBS];
|
||||
|
||||
/*===========================================================================*
|
||||
* alloc_data_slot *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct data_store *alloc_data_slot(void)
|
||||
static struct data_store *alloc_data_slot(void)
|
||||
{
|
||||
/* Allocate a new data slot. */
|
||||
int i;
|
||||
@@ -24,7 +24,7 @@ PRIVATE struct data_store *alloc_data_slot(void)
|
||||
/*===========================================================================*
|
||||
* alloc_sub_slot *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct subscription *alloc_sub_slot(void)
|
||||
static struct subscription *alloc_sub_slot(void)
|
||||
{
|
||||
/* Allocate a new subscription slot. */
|
||||
int i;
|
||||
@@ -40,7 +40,7 @@ PRIVATE struct subscription *alloc_sub_slot(void)
|
||||
/*===========================================================================*
|
||||
* lookup_entry *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct data_store *lookup_entry(const char *key_name, int type)
|
||||
static struct data_store *lookup_entry(const char *key_name, int type)
|
||||
{
|
||||
/* Lookup an existing entry by key and type. */
|
||||
int i;
|
||||
@@ -58,7 +58,7 @@ PRIVATE struct data_store *lookup_entry(const char *key_name, int type)
|
||||
/*===========================================================================*
|
||||
* lookup_label_entry *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct data_store *lookup_label_entry(unsigned num)
|
||||
static struct data_store *lookup_label_entry(unsigned num)
|
||||
{
|
||||
/* Lookup an existing label entry by num. */
|
||||
int i;
|
||||
@@ -76,7 +76,7 @@ PRIVATE struct data_store *lookup_label_entry(unsigned num)
|
||||
/*===========================================================================*
|
||||
* lookup_sub *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct subscription *lookup_sub(const char *owner)
|
||||
static struct subscription *lookup_sub(const char *owner)
|
||||
{
|
||||
/* Lookup an existing subscription given its owner. */
|
||||
int i;
|
||||
@@ -93,7 +93,7 @@ PRIVATE struct subscription *lookup_sub(const char *owner)
|
||||
/*===========================================================================*
|
||||
* ds_getprocname *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *ds_getprocname(endpoint_t e)
|
||||
static char *ds_getprocname(endpoint_t e)
|
||||
{
|
||||
/* Get a process name given its endpoint. */
|
||||
struct data_store *dsp;
|
||||
@@ -113,7 +113,7 @@ PRIVATE char *ds_getprocname(endpoint_t e)
|
||||
/*===========================================================================*
|
||||
* ds_getprocep *
|
||||
*===========================================================================*/
|
||||
PRIVATE endpoint_t ds_getprocep(const char *s)
|
||||
static endpoint_t ds_getprocep(const char *s)
|
||||
{
|
||||
/* Get a process endpoint given its name. */
|
||||
struct data_store *dsp;
|
||||
@@ -126,7 +126,7 @@ PRIVATE endpoint_t ds_getprocep(const char *s)
|
||||
/*===========================================================================*
|
||||
* check_auth *
|
||||
*===========================================================================*/
|
||||
PRIVATE int check_auth(const struct data_store *p, endpoint_t ep, int perm)
|
||||
static int check_auth(const struct data_store *p, endpoint_t ep, int perm)
|
||||
{
|
||||
/* Check authorization for a given type of permission. */
|
||||
char *source;
|
||||
@@ -141,7 +141,7 @@ PRIVATE int check_auth(const struct data_store *p, endpoint_t ep, int perm)
|
||||
/*===========================================================================*
|
||||
* get_key_name *
|
||||
*===========================================================================*/
|
||||
PRIVATE int get_key_name(const message *m_ptr, char *key_name)
|
||||
static int get_key_name(const message *m_ptr, char *key_name)
|
||||
{
|
||||
/* Get key name given an input message. */
|
||||
int r;
|
||||
@@ -169,7 +169,7 @@ PRIVATE int get_key_name(const message *m_ptr, char *key_name)
|
||||
/*===========================================================================*
|
||||
* check_snapshot_index *
|
||||
*===========================================================================*/
|
||||
PRIVATE int check_snapshot_index(const struct data_store *dsp, int index)
|
||||
static int check_snapshot_index(const struct data_store *dsp, int index)
|
||||
{
|
||||
/* See if the given snapshot index is valid. */
|
||||
int min;
|
||||
@@ -184,7 +184,7 @@ PRIVATE int check_snapshot_index(const struct data_store *dsp, int index)
|
||||
/*===========================================================================*
|
||||
* check_sub_match *
|
||||
*===========================================================================*/
|
||||
PRIVATE int check_sub_match(const struct subscription *subp,
|
||||
static int check_sub_match(const struct subscription *subp,
|
||||
struct data_store *dsp, endpoint_t ep)
|
||||
{
|
||||
/* Check if an entry matches a subscription. Return 1 in case of match. */
|
||||
@@ -196,7 +196,7 @@ PRIVATE int check_sub_match(const struct subscription *subp,
|
||||
/*===========================================================================*
|
||||
* update_subscribers *
|
||||
*===========================================================================*/
|
||||
PRIVATE void update_subscribers(struct data_store *dsp, int set)
|
||||
static void update_subscribers(struct data_store *dsp, int set)
|
||||
{
|
||||
/* If set = 1, set bit in the sub bitmap of any subscription matching the given
|
||||
* entry, otherwise clear it. In both cases, notify the subscriber.
|
||||
@@ -227,7 +227,7 @@ PRIVATE void update_subscribers(struct data_store *dsp, int set)
|
||||
/*===========================================================================*
|
||||
* map_service *
|
||||
*===========================================================================*/
|
||||
PRIVATE int map_service(const struct rprocpub *rpub)
|
||||
static int map_service(const struct rprocpub *rpub)
|
||||
{
|
||||
/* Map a new service by registering its label. */
|
||||
struct data_store *dsp;
|
||||
@@ -252,7 +252,7 @@ PRIVATE int map_service(const struct rprocpub *rpub)
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PUBLIC int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info)
|
||||
int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info)
|
||||
{
|
||||
/* Initialize the data store server. */
|
||||
int i, r;
|
||||
@@ -285,7 +285,7 @@ PUBLIC int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info)
|
||||
/*===========================================================================*
|
||||
* do_publish *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_publish(message *m_ptr)
|
||||
int do_publish(message *m_ptr)
|
||||
{
|
||||
struct data_store *dsp;
|
||||
char key_name[DS_MAX_KEYLEN];
|
||||
@@ -402,7 +402,7 @@ PUBLIC int do_publish(message *m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_retrieve *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_retrieve(message *m_ptr)
|
||||
int do_retrieve(message *m_ptr)
|
||||
{
|
||||
struct data_store *dsp;
|
||||
char key_name[DS_MAX_KEYLEN];
|
||||
@@ -493,7 +493,7 @@ PUBLIC int do_retrieve(message *m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_retrieve_label *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_retrieve_label(const message *m_ptr)
|
||||
int do_retrieve_label(const message *m_ptr)
|
||||
{
|
||||
struct data_store *dsp;
|
||||
int r;
|
||||
@@ -517,7 +517,7 @@ PUBLIC int do_retrieve_label(const message *m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_subscribe *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_subscribe(message *m_ptr)
|
||||
int do_subscribe(message *m_ptr)
|
||||
{
|
||||
char regex[DS_MAX_KEYLEN+2];
|
||||
struct subscription *subp;
|
||||
@@ -593,7 +593,7 @@ PUBLIC int do_subscribe(message *m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_check *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_check(message *m_ptr)
|
||||
int do_check(message *m_ptr)
|
||||
{
|
||||
struct subscription *subp;
|
||||
char *owner;
|
||||
@@ -640,7 +640,7 @@ PUBLIC int do_check(message *m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_delete *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_delete(message *m_ptr)
|
||||
int do_delete(message *m_ptr)
|
||||
{
|
||||
struct data_store *dsp;
|
||||
char key_name[DS_MAX_KEYLEN];
|
||||
@@ -729,7 +729,7 @@ PUBLIC int do_delete(message *m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_snapshot *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_snapshot(message *m_ptr)
|
||||
int do_snapshot(message *m_ptr)
|
||||
{
|
||||
struct data_store *dsp;
|
||||
struct dsi_map *p;
|
||||
@@ -770,7 +770,7 @@ PUBLIC int do_snapshot(message *m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_getsysinfo *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getsysinfo(const message *m_ptr)
|
||||
int do_getsysinfo(const message *m_ptr)
|
||||
{
|
||||
vir_bytes src_addr;
|
||||
size_t length;
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
#include "const.h"
|
||||
|
||||
|
||||
FORWARD block_t alloc_block_bit(struct super_block *sp, block_t origin,
|
||||
static block_t alloc_block_bit(struct super_block *sp, block_t origin,
|
||||
struct inode *rip);
|
||||
|
||||
/*===========================================================================*
|
||||
* discard_preallocated_blocks *
|
||||
*===========================================================================*/
|
||||
PUBLIC void discard_preallocated_blocks(struct inode *rip)
|
||||
void discard_preallocated_blocks(struct inode *rip)
|
||||
{
|
||||
/* When called for rip, discard (free) blocks preallocated for rip,
|
||||
* otherwise discard all preallocated blocks.
|
||||
@@ -68,7 +68,7 @@ PUBLIC void discard_preallocated_blocks(struct inode *rip)
|
||||
/*===========================================================================*
|
||||
* alloc_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC block_t alloc_block(struct inode *rip, block_t block)
|
||||
block_t alloc_block(struct inode *rip, block_t block)
|
||||
{
|
||||
/* Allocate a block for inode. If block is provided, then use it as a goal:
|
||||
* try to allocate this block or his neghbors.
|
||||
@@ -141,13 +141,13 @@ PUBLIC block_t alloc_block(struct inode *rip, block_t block)
|
||||
}
|
||||
|
||||
|
||||
FORWARD void check_block_number(block_t block, struct super_block *sp,
|
||||
static void check_block_number(block_t block, struct super_block *sp,
|
||||
struct group_desc *gd);
|
||||
|
||||
/*===========================================================================*
|
||||
* alloc_block_bit *
|
||||
*===========================================================================*/
|
||||
PRIVATE block_t alloc_block_bit(sp, goal, rip)
|
||||
static block_t alloc_block_bit(sp, goal, rip)
|
||||
struct super_block *sp; /* the filesystem to allocate from */
|
||||
block_t goal; /* try to allocate near this block */
|
||||
struct inode *rip; /* used for preallocation */
|
||||
@@ -273,7 +273,7 @@ struct inode *rip; /* used for preallocation */
|
||||
/*===========================================================================*
|
||||
* free_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC void free_block(struct super_block *sp, bit_t bit_returned)
|
||||
void free_block(struct super_block *sp, bit_t bit_returned)
|
||||
{
|
||||
/* Return a block by turning off its bitmap bit. */
|
||||
int group; /* group number of bit_returned */
|
||||
@@ -329,7 +329,7 @@ PUBLIC void free_block(struct super_block *sp, bit_t bit_returned)
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void check_block_number(block_t block, struct super_block *sp,
|
||||
static void check_block_number(block_t block, struct super_block *sp,
|
||||
struct group_desc *gd)
|
||||
{
|
||||
|
||||
|
||||
@@ -25,15 +25,15 @@
|
||||
#include "super.h"
|
||||
#include "inode.h"
|
||||
|
||||
FORWARD void rm_lru(struct buf *bp);
|
||||
FORWARD void rw_block(struct buf *, int);
|
||||
static void rm_lru(struct buf *bp);
|
||||
static void rw_block(struct buf *, int);
|
||||
|
||||
PRIVATE int vmcache_avail = -1; /* 0 if not available, >0 if available. */
|
||||
static int vmcache_avail = -1; /* 0 if not available, >0 if available. */
|
||||
|
||||
/*===========================================================================*
|
||||
* get_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct buf *get_block(
|
||||
struct buf *get_block(
|
||||
register dev_t dev, /* on which device is the block? */
|
||||
register block_t block, /* which block is wanted? */
|
||||
int only_search /* if NO_READ, don't read, else act normal */
|
||||
@@ -218,7 +218,7 @@ PUBLIC struct buf *get_block(
|
||||
/*===========================================================================*
|
||||
* put_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC void put_block(
|
||||
void put_block(
|
||||
register struct buf *bp, /* pointer to the buffer to be released */
|
||||
int block_type /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */
|
||||
)
|
||||
@@ -281,7 +281,7 @@ PUBLIC void put_block(
|
||||
/*===========================================================================*
|
||||
* rw_block *
|
||||
*===========================================================================*/
|
||||
PRIVATE void rw_block(
|
||||
static void rw_block(
|
||||
register struct buf *bp, /* buffer pointer */
|
||||
int rw_flag /* READING or WRITING */
|
||||
)
|
||||
@@ -327,7 +327,7 @@ PRIVATE void rw_block(
|
||||
/*===========================================================================*
|
||||
* invalidate *
|
||||
*===========================================================================*/
|
||||
PUBLIC void invalidate(
|
||||
void invalidate(
|
||||
dev_t device /* device whose blocks are to be purged */
|
||||
)
|
||||
{
|
||||
@@ -344,7 +344,7 @@ PUBLIC void invalidate(
|
||||
/*===========================================================================*
|
||||
* flushall *
|
||||
*===========================================================================*/
|
||||
PUBLIC void flushall(
|
||||
void flushall(
|
||||
dev_t dev /* device to flush */
|
||||
)
|
||||
{
|
||||
@@ -373,7 +373,7 @@ PUBLIC void flushall(
|
||||
/*===========================================================================*
|
||||
* rw_scattered *
|
||||
*===========================================================================*/
|
||||
PUBLIC void rw_scattered(
|
||||
void rw_scattered(
|
||||
dev_t dev, /* major-minor device number */
|
||||
struct buf **bufq, /* pointer to array of buffers */
|
||||
int bufqsize, /* number of buffers */
|
||||
@@ -476,7 +476,7 @@ PUBLIC void rw_scattered(
|
||||
/*===========================================================================*
|
||||
* rm_lru *
|
||||
*===========================================================================*/
|
||||
PRIVATE void rm_lru(
|
||||
static void rm_lru(
|
||||
struct buf *bp
|
||||
)
|
||||
{
|
||||
@@ -500,7 +500,7 @@ PRIVATE void rm_lru(
|
||||
/*===========================================================================*
|
||||
* set_blocksize *
|
||||
*===========================================================================*/
|
||||
PUBLIC void set_blocksize(unsigned int blocksize, u32_t blocks,
|
||||
void set_blocksize(unsigned int blocksize, u32_t blocks,
|
||||
u32_t freeblocks, dev_t majordev)
|
||||
{
|
||||
struct buf *bp;
|
||||
@@ -524,7 +524,7 @@ PUBLIC void set_blocksize(unsigned int blocksize, u32_t blocks,
|
||||
/*===========================================================================*
|
||||
* buf_pool *
|
||||
*===========================================================================*/
|
||||
PUBLIC void buf_pool(int new_nr_bufs)
|
||||
void buf_pool(int new_nr_bufs)
|
||||
{
|
||||
/* Initialize the buffer pool. */
|
||||
register struct buf *bp;
|
||||
|
||||
@@ -19,17 +19,17 @@
|
||||
#include "const.h"
|
||||
|
||||
|
||||
FORWARD bit_t alloc_inode_bit(struct super_block *sp, struct inode
|
||||
static bit_t alloc_inode_bit(struct super_block *sp, struct inode
|
||||
*parent, int is_dir);
|
||||
FORWARD void free_inode_bit(struct super_block *sp, bit_t bit_returned,
|
||||
static void free_inode_bit(struct super_block *sp, bit_t bit_returned,
|
||||
int is_dir);
|
||||
FORWARD void wipe_inode(struct inode *rip);
|
||||
static void wipe_inode(struct inode *rip);
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* alloc_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *alloc_inode(struct inode *parent, mode_t bits)
|
||||
struct inode *alloc_inode(struct inode *parent, mode_t bits)
|
||||
{
|
||||
/* Allocate a free inode on parent's dev, and return a pointer to it. */
|
||||
|
||||
@@ -87,7 +87,7 @@ PUBLIC struct inode *alloc_inode(struct inode *parent, mode_t bits)
|
||||
/*===========================================================================*
|
||||
* free_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void free_inode(
|
||||
void free_inode(
|
||||
register struct inode *rip /* inode to free */
|
||||
)
|
||||
{
|
||||
@@ -108,20 +108,20 @@ PUBLIC void free_inode(
|
||||
}
|
||||
|
||||
|
||||
FORWARD int find_group_dir(struct super_block *sp, struct inode
|
||||
static int find_group_dir(struct super_block *sp, struct inode
|
||||
*parent);
|
||||
FORWARD int find_group_hashalloc(struct super_block *sp, struct inode
|
||||
static int find_group_hashalloc(struct super_block *sp, struct inode
|
||||
*parent);
|
||||
FORWARD int find_group_any(struct super_block *sp, struct inode
|
||||
static int find_group_any(struct super_block *sp, struct inode
|
||||
*parent);
|
||||
FORWARD int find_group_orlov(struct super_block *sp, struct inode
|
||||
static int find_group_orlov(struct super_block *sp, struct inode
|
||||
*parent);
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* alloc_inode_bit *
|
||||
*===========================================================================*/
|
||||
PRIVATE bit_t alloc_inode_bit(sp, parent, is_dir)
|
||||
static bit_t alloc_inode_bit(sp, parent, is_dir)
|
||||
struct super_block *sp; /* the filesystem to allocate from */
|
||||
struct inode *parent; /* parent of newly allocated inode */
|
||||
int is_dir; /* inode will be a directory if it is TRUE */
|
||||
@@ -202,7 +202,7 @@ int is_dir; /* inode will be a directory if it is TRUE */
|
||||
/*===========================================================================*
|
||||
* free_inode_bit *
|
||||
*===========================================================================*/
|
||||
PRIVATE void free_inode_bit(struct super_block *sp, bit_t bit_returned,
|
||||
static void free_inode_bit(struct super_block *sp, bit_t bit_returned,
|
||||
int is_dir)
|
||||
{
|
||||
/* Return an inode by turning off its bitmap bit. */
|
||||
@@ -252,7 +252,7 @@ PRIVATE void free_inode_bit(struct super_block *sp, bit_t bit_returned,
|
||||
|
||||
|
||||
/* it's implemented very close to the linux' find_group_dir() */
|
||||
PRIVATE int find_group_dir(struct super_block *sp, struct inode *parent)
|
||||
static int find_group_dir(struct super_block *sp, struct inode *parent)
|
||||
{
|
||||
int avefreei = sp->s_free_inodes_count / sp->s_groups_count;
|
||||
struct group_desc *gd, *best_gd = NULL;
|
||||
@@ -282,7 +282,7 @@ PRIVATE int find_group_dir(struct super_block *sp, struct inode *parent)
|
||||
* 2) Quadradically rehash on the group number.
|
||||
* 3) Make a linear search for free inode.
|
||||
*/
|
||||
PRIVATE int find_group_hashalloc(struct super_block *sp, struct inode *parent)
|
||||
static int find_group_hashalloc(struct super_block *sp, struct inode *parent)
|
||||
{
|
||||
int ngroups = sp->s_groups_count;
|
||||
struct group_desc *gd;
|
||||
@@ -339,7 +339,7 @@ PRIVATE int find_group_hashalloc(struct super_block *sp, struct inode *parent)
|
||||
/* Find first group which has free inode slot.
|
||||
* This is similar to what MFS does.
|
||||
*/
|
||||
PRIVATE int find_group_any(struct super_block *sp, struct inode *parent)
|
||||
static int find_group_any(struct super_block *sp, struct inode *parent)
|
||||
{
|
||||
int ngroups = sp->s_groups_count;
|
||||
struct group_desc *gd;
|
||||
@@ -371,7 +371,7 @@ PRIVATE int find_group_any(struct super_block *sp, struct inode *parent)
|
||||
* min_inodes).
|
||||
*
|
||||
*/
|
||||
PRIVATE int find_group_orlov(struct super_block *sp, struct inode *parent)
|
||||
static int find_group_orlov(struct super_block *sp, struct inode *parent)
|
||||
{
|
||||
int avefreei = sp->s_free_inodes_count / sp->s_groups_count;
|
||||
int avefreeb = sp->s_free_blocks_count / sp->s_groups_count;
|
||||
@@ -449,7 +449,7 @@ PRIVATE int find_group_orlov(struct super_block *sp, struct inode *parent)
|
||||
/*===========================================================================*
|
||||
* wipe_inode *
|
||||
*===========================================================================*/
|
||||
PRIVATE void wipe_inode(
|
||||
static void wipe_inode(
|
||||
register struct inode *rip /* the inode to be erased */
|
||||
)
|
||||
{
|
||||
|
||||
@@ -22,16 +22,16 @@
|
||||
#include "super.h"
|
||||
#include <minix/vfsif.h>
|
||||
|
||||
FORWARD void icopy(struct inode *rip, d_inode *dip, int direction, int
|
||||
static void icopy(struct inode *rip, d_inode *dip, int direction, int
|
||||
norm);
|
||||
FORWARD void addhash_inode(struct inode *node);
|
||||
FORWARD void unhash_inode(struct inode *node);
|
||||
static void addhash_inode(struct inode *node);
|
||||
static void unhash_inode(struct inode *node);
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_putnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_putnode(void)
|
||||
int fs_putnode(void)
|
||||
{
|
||||
/* Find the inode specified by the request message and decrease its counter.*/
|
||||
|
||||
@@ -70,7 +70,7 @@ PUBLIC int fs_putnode(void)
|
||||
/*===========================================================================*
|
||||
* init_inode_cache *
|
||||
*===========================================================================*/
|
||||
PUBLIC void init_inode_cache()
|
||||
void init_inode_cache()
|
||||
{
|
||||
struct inode *rip;
|
||||
struct inodelist *rlp;
|
||||
@@ -96,7 +96,7 @@ PUBLIC void init_inode_cache()
|
||||
/*===========================================================================*
|
||||
* addhash_inode *
|
||||
*===========================================================================*/
|
||||
PRIVATE void addhash_inode(struct inode *node)
|
||||
static void addhash_inode(struct inode *node)
|
||||
{
|
||||
int hashi = node->i_num & INODE_HASH_MASK;
|
||||
|
||||
@@ -108,7 +108,7 @@ PRIVATE void addhash_inode(struct inode *node)
|
||||
/*===========================================================================*
|
||||
* unhash_inode *
|
||||
*===========================================================================*/
|
||||
PRIVATE void unhash_inode(struct inode *node)
|
||||
static void unhash_inode(struct inode *node)
|
||||
{
|
||||
/* remove from hash table */
|
||||
LIST_REMOVE(node, i_hash);
|
||||
@@ -118,7 +118,7 @@ PRIVATE void unhash_inode(struct inode *node)
|
||||
/*===========================================================================*
|
||||
* get_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *get_inode(
|
||||
struct inode *get_inode(
|
||||
dev_t dev, /* device on which inode resides */
|
||||
ino_t numb /* inode number (ANSI: may not be unshort) */
|
||||
)
|
||||
@@ -196,7 +196,7 @@ PUBLIC struct inode *get_inode(
|
||||
/*===========================================================================*
|
||||
* find_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *find_inode(
|
||||
struct inode *find_inode(
|
||||
dev_t dev, /* device on which inode resides */
|
||||
ino_t numb /* inode number (ANSI: may not be unshort) */
|
||||
)
|
||||
@@ -221,7 +221,7 @@ PUBLIC struct inode *find_inode(
|
||||
/*===========================================================================*
|
||||
* put_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void put_inode(
|
||||
void put_inode(
|
||||
register struct inode *rip /* pointer to inode to be released */
|
||||
)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ PUBLIC void put_inode(
|
||||
/*===========================================================================*
|
||||
* update_times *
|
||||
*===========================================================================*/
|
||||
PUBLIC void update_times(
|
||||
void update_times(
|
||||
register struct inode *rip /* pointer to inode to be read/written */
|
||||
)
|
||||
{
|
||||
@@ -302,7 +302,7 @@ PUBLIC void update_times(
|
||||
/*===========================================================================*
|
||||
* rw_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void rw_inode(
|
||||
void rw_inode(
|
||||
register struct inode *rip, /* pointer to inode to be read/written */
|
||||
int rw_flag /* READING or WRITING */
|
||||
)
|
||||
@@ -355,7 +355,7 @@ PUBLIC void rw_inode(
|
||||
/*===========================================================================*
|
||||
* icopy *
|
||||
*===========================================================================*/
|
||||
PRIVATE void icopy(
|
||||
static void icopy(
|
||||
register struct inode *rip, /* pointer to the in-core inode struct */
|
||||
register d_inode *dip, /* pointer to the on-disk struct */
|
||||
int direction, /* READING (from disk) or WRITING (to disk) */
|
||||
@@ -415,7 +415,7 @@ PRIVATE void icopy(
|
||||
/*===========================================================================*
|
||||
* dup_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void dup_inode(
|
||||
void dup_inode(
|
||||
struct inode *ip /* The inode to be duplicated. */
|
||||
)
|
||||
{
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
|
||||
#define SAME 1000
|
||||
|
||||
FORWARD int freesp_inode(struct inode *rip, off_t st, off_t end);
|
||||
FORWARD int remove_dir(struct inode *rldirp, struct inode *rip, char
|
||||
static int freesp_inode(struct inode *rip, off_t st, off_t end);
|
||||
static int remove_dir(struct inode *rldirp, struct inode *rip, char
|
||||
dir_name[NAME_MAX + 1]);
|
||||
FORWARD int unlink_file(struct inode *dirp, struct inode *rip, char
|
||||
static int unlink_file(struct inode *dirp, struct inode *rip, char
|
||||
file_name[NAME_MAX + 1]);
|
||||
FORWARD off_t nextblock(off_t pos, int blocksize);
|
||||
FORWARD void zeroblock_half(struct inode *i, off_t p, int l);
|
||||
FORWARD void zeroblock_range(struct inode *i, off_t p, off_t h);
|
||||
static off_t nextblock(off_t pos, int blocksize);
|
||||
static void zeroblock_half(struct inode *i, off_t p, int l);
|
||||
static void zeroblock_range(struct inode *i, off_t p, off_t h);
|
||||
|
||||
/* Args to zeroblock_half() */
|
||||
#define FIRST_HALF 0
|
||||
@@ -30,7 +30,7 @@ FORWARD void zeroblock_range(struct inode *i, off_t p, off_t h);
|
||||
/*===========================================================================*
|
||||
* fs_link *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_link()
|
||||
int fs_link()
|
||||
{
|
||||
/* Perform the link(name1, name2) system call. */
|
||||
|
||||
@@ -116,7 +116,7 @@ PUBLIC int fs_link()
|
||||
/*===========================================================================*
|
||||
* fs_unlink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_unlink()
|
||||
int fs_unlink()
|
||||
{
|
||||
/* Perform the unlink(name) or rmdir(name) system call. The code for these two
|
||||
* is almost the same. They differ only in some condition testing. Unlink()
|
||||
@@ -179,7 +179,7 @@ PUBLIC int fs_unlink()
|
||||
/*===========================================================================*
|
||||
* fs_rdlink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_rdlink()
|
||||
int fs_rdlink()
|
||||
{
|
||||
block_t b; /* block containing link text */
|
||||
struct buf *bp = NULL; /* buffer containing link text */
|
||||
@@ -232,7 +232,7 @@ PUBLIC int fs_rdlink()
|
||||
/*===========================================================================*
|
||||
* remove_dir *
|
||||
*===========================================================================*/
|
||||
PRIVATE int remove_dir(rldirp, rip, dir_name)
|
||||
static int remove_dir(rldirp, rip, dir_name)
|
||||
struct inode *rldirp; /* parent directory */
|
||||
struct inode *rip; /* directory to be removed */
|
||||
char dir_name[NAME_MAX + 1]; /* name of directory to be removed */
|
||||
@@ -268,7 +268,7 @@ char dir_name[NAME_MAX + 1]; /* name of directory to be removed */
|
||||
/*===========================================================================*
|
||||
* unlink_file *
|
||||
*===========================================================================*/
|
||||
PRIVATE int unlink_file(dirp, rip, file_name)
|
||||
static int unlink_file(dirp, rip, file_name)
|
||||
struct inode *dirp; /* parent directory of file */
|
||||
struct inode *rip; /* inode of file, may be NULL too. */
|
||||
char file_name[NAME_MAX + 1]; /* name of file to be removed */
|
||||
@@ -304,7 +304,7 @@ char file_name[NAME_MAX + 1]; /* name of file to be removed */
|
||||
/*===========================================================================*
|
||||
* fs_rename *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_rename()
|
||||
int fs_rename()
|
||||
{
|
||||
/* Perform the rename(name1, name2) system call. */
|
||||
struct inode *old_dirp, *old_ip; /* ptrs to old dir, file inodes */
|
||||
@@ -517,7 +517,7 @@ PUBLIC int fs_rename()
|
||||
/*===========================================================================*
|
||||
* fs_ftrunc *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_ftrunc(void)
|
||||
int fs_ftrunc(void)
|
||||
{
|
||||
struct inode *rip;
|
||||
off_t start, end;
|
||||
@@ -541,7 +541,7 @@ PUBLIC int fs_ftrunc(void)
|
||||
/*===========================================================================*
|
||||
* truncate_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int truncate_inode(rip, newsize)
|
||||
int truncate_inode(rip, newsize)
|
||||
register struct inode *rip; /* pointer to inode to be truncated */
|
||||
off_t newsize; /* inode must become this size */
|
||||
{
|
||||
@@ -587,7 +587,7 @@ off_t newsize; /* inode must become this size */
|
||||
/*===========================================================================*
|
||||
* freesp_inode *
|
||||
*===========================================================================*/
|
||||
PRIVATE int freesp_inode(rip, start, end)
|
||||
static int freesp_inode(rip, start, end)
|
||||
register struct inode *rip; /* pointer to inode to be partly freed */
|
||||
off_t start, end; /* range of bytes to free (end uninclusive) */
|
||||
{
|
||||
@@ -660,7 +660,7 @@ off_t start, end; /* range of bytes to free (end uninclusive) */
|
||||
/*===========================================================================*
|
||||
* nextblock *
|
||||
*===========================================================================*/
|
||||
PRIVATE off_t nextblock(pos, block_size)
|
||||
static off_t nextblock(pos, block_size)
|
||||
off_t pos;
|
||||
unsigned short block_size;
|
||||
{
|
||||
@@ -678,7 +678,7 @@ unsigned short block_size;
|
||||
/*===========================================================================*
|
||||
* zeroblock_half *
|
||||
*===========================================================================*/
|
||||
PRIVATE void zeroblock_half(rip, pos, half)
|
||||
static void zeroblock_half(rip, pos, half)
|
||||
struct inode *rip;
|
||||
off_t pos;
|
||||
int half;
|
||||
@@ -708,7 +708,7 @@ int half;
|
||||
/*===========================================================================*
|
||||
* zeroblock_range *
|
||||
*===========================================================================*/
|
||||
PRIVATE void zeroblock_range(rip, pos, len)
|
||||
static void zeroblock_range(rip, pos, len)
|
||||
struct inode *rip;
|
||||
off_t pos;
|
||||
off_t len;
|
||||
|
||||
@@ -13,18 +13,18 @@
|
||||
#include "inode.h"
|
||||
|
||||
/* Declare some local functions. */
|
||||
FORWARD void get_work(message *m_in);
|
||||
FORWARD void reply(endpoint_t who, message *m_out);
|
||||
static void get_work(message *m_in);
|
||||
static void reply(endpoint_t who, message *m_out);
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
FORWARD void sef_cb_signal_handler(int signo);
|
||||
static void sef_local_startup(void);
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
static void sef_cb_signal_handler(int signo);
|
||||
|
||||
EXTERN int env_argc;
|
||||
EXTERN char **env_argv;
|
||||
|
||||
PRIVATE struct optset optset_table[] = {
|
||||
static struct optset optset_table[] = {
|
||||
{ "sb", OPT_INT, &opt.block_with_super, 0 },
|
||||
{ "orlov", OPT_BOOL, &opt.use_orlov, TRUE },
|
||||
{ "oldalloc", OPT_BOOL, &opt.use_orlov, FALSE },
|
||||
@@ -38,7 +38,7 @@ PRIVATE struct optset optset_table[] = {
|
||||
/*===========================================================================*
|
||||
* main *
|
||||
*===========================================================================*/
|
||||
PUBLIC int main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
/* This is the main routine of this service. The main loop consists of
|
||||
* three major activities: getting new work, processing the work, and
|
||||
@@ -107,7 +107,7 @@ PUBLIC int main(int argc, char *argv[])
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -125,7 +125,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
{
|
||||
/* Initialize the Minix file server. */
|
||||
int i;
|
||||
@@ -164,7 +164,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
/*===========================================================================*
|
||||
* sef_cb_signal_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_cb_signal_handler(int signo)
|
||||
static void sef_cb_signal_handler(int signo)
|
||||
{
|
||||
/* Only check for termination signal, ignore anything else. */
|
||||
if (signo != SIGTERM) return;
|
||||
@@ -181,7 +181,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
|
||||
/*===========================================================================*
|
||||
* get_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void get_work(m_in)
|
||||
static void get_work(m_in)
|
||||
message *m_in; /* pointer to message */
|
||||
{
|
||||
int r, srcok = 0;
|
||||
@@ -209,7 +209,7 @@ message *m_in; /* pointer to message */
|
||||
/*===========================================================================*
|
||||
* reply *
|
||||
*===========================================================================*/
|
||||
PRIVATE void reply(
|
||||
static void reply(
|
||||
endpoint_t who,
|
||||
message *m_out /* report result */
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_sync *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_sync()
|
||||
int fs_sync()
|
||||
{
|
||||
/* Perform the sync() system call. Flush all the tables.
|
||||
* The order in which the various tables are flushed is critical. The
|
||||
@@ -49,7 +49,7 @@ PUBLIC int fs_sync()
|
||||
/*===========================================================================*
|
||||
* fs_flush *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_flush()
|
||||
int fs_flush()
|
||||
{
|
||||
/* Flush the blocks of a device from the cache after writing any dirty blocks
|
||||
* to disk.
|
||||
@@ -67,7 +67,7 @@ PUBLIC int fs_flush()
|
||||
/*===========================================================================*
|
||||
* fs_new_driver *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_new_driver(void)
|
||||
int fs_new_driver(void)
|
||||
{
|
||||
/* Set a new driver endpoint for this device. */
|
||||
dev_t dev;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_readsuper *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_readsuper()
|
||||
int fs_readsuper()
|
||||
{
|
||||
/* This function reads the superblock of the partition, gets the root inode
|
||||
* and sends back the details of them. Note, that the FS process does not
|
||||
@@ -170,7 +170,7 @@ PUBLIC int fs_readsuper()
|
||||
/*===========================================================================*
|
||||
* fs_mountpoint *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_mountpoint()
|
||||
int fs_mountpoint()
|
||||
{
|
||||
/* This function looks up the mount point, it checks the condition whether
|
||||
* the partition can be mounted on the inode or not.
|
||||
@@ -201,7 +201,7 @@ PUBLIC int fs_mountpoint()
|
||||
/*===========================================================================*
|
||||
* fs_unmount *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_unmount()
|
||||
int fs_unmount()
|
||||
{
|
||||
/* Unmount a file system by device number. */
|
||||
int count;
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
#include "super.h"
|
||||
#include <minix/vfsif.h>
|
||||
|
||||
FORWARD struct inode *new_node(struct inode *ldirp, char *string, mode_t
|
||||
static struct inode *new_node(struct inode *ldirp, char *string, mode_t
|
||||
bits, block_t z0);
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_create *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_create()
|
||||
int fs_create()
|
||||
{
|
||||
phys_bytes len;
|
||||
int r;
|
||||
@@ -78,7 +78,7 @@ PUBLIC int fs_create()
|
||||
/*===========================================================================*
|
||||
* fs_mknod *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_mknod()
|
||||
int fs_mknod()
|
||||
{
|
||||
struct inode *ip, *ldirp;
|
||||
char lastc[NAME_MAX + 1];
|
||||
@@ -114,7 +114,7 @@ PUBLIC int fs_mknod()
|
||||
/*===========================================================================*
|
||||
* fs_mkdir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_mkdir()
|
||||
int fs_mkdir()
|
||||
{
|
||||
int r1, r2; /* status codes */
|
||||
ino_t dot, dotdot; /* inode numbers for . and .. */
|
||||
@@ -184,7 +184,7 @@ PUBLIC int fs_mkdir()
|
||||
/*===========================================================================*
|
||||
* fs_slink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_slink()
|
||||
int fs_slink()
|
||||
{
|
||||
phys_bytes len;
|
||||
struct inode *sip; /* inode containing symbolic link */
|
||||
@@ -275,7 +275,7 @@ PUBLIC int fs_slink()
|
||||
/*===========================================================================*
|
||||
* new_node *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct inode *new_node(struct inode *ldirp,
|
||||
static struct inode *new_node(struct inode *ldirp,
|
||||
char *string, mode_t bits, block_t b0)
|
||||
{
|
||||
/* New_node() is called by fs_open(), fs_mknod(), and fs_mkdir().
|
||||
@@ -349,7 +349,7 @@ PRIVATE struct inode *new_node(struct inode *ldirp,
|
||||
/*===========================================================================*
|
||||
* fs_inhibread *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_inhibread()
|
||||
int fs_inhibread()
|
||||
{
|
||||
struct inode *rip;
|
||||
|
||||
|
||||
@@ -23,18 +23,18 @@
|
||||
#include <minix/vfsif.h>
|
||||
#include <minix/libminixfs.h>
|
||||
|
||||
PUBLIC char dot1[2] = "."; /* used for search_dir to bypass the access */
|
||||
PUBLIC char dot2[3] = ".."; /* permissions for . and .. */
|
||||
char dot1[2] = "."; /* used for search_dir to bypass the access */
|
||||
char dot2[3] = ".."; /* permissions for . and .. */
|
||||
|
||||
FORWARD char *get_name(char *name, char string[NAME_MAX+1]);
|
||||
FORWARD int ltraverse(struct inode *rip, char *suffix);
|
||||
FORWARD int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct
|
||||
static char *get_name(char *name, char string[NAME_MAX+1]);
|
||||
static int ltraverse(struct inode *rip, char *suffix);
|
||||
static int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct
|
||||
inode **res_inop, size_t *offsetp, int *symlinkp);
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_lookup *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_lookup()
|
||||
int fs_lookup()
|
||||
{
|
||||
cp_grant_id_t grant;
|
||||
int r, r1, flags, symlinks;
|
||||
@@ -120,7 +120,7 @@ PUBLIC int fs_lookup()
|
||||
/*===========================================================================*
|
||||
* parse_path *
|
||||
*===========================================================================*/
|
||||
PRIVATE int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp)
|
||||
static int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp)
|
||||
ino_t dir_ino;
|
||||
ino_t root_ino;
|
||||
int flags;
|
||||
@@ -280,7 +280,7 @@ int *symlinkp;
|
||||
/*===========================================================================*
|
||||
* ltraverse *
|
||||
*===========================================================================*/
|
||||
PRIVATE int ltraverse(rip, suffix)
|
||||
static int ltraverse(rip, suffix)
|
||||
register struct inode *rip; /* symbolic link */
|
||||
char *suffix; /* current remaining path. Has to point in the
|
||||
* user_path buffer
|
||||
@@ -363,7 +363,7 @@ char *suffix; /* current remaining path. Has to point in the
|
||||
/*===========================================================================*
|
||||
* advance *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *advance(dirp, string, chk_perm)
|
||||
struct inode *advance(dirp, string, chk_perm)
|
||||
struct inode *dirp; /* inode for directory to be searched */
|
||||
char string[NAME_MAX + 1]; /* component name to look for */
|
||||
int chk_perm; /* check permissions when string is looked up*/
|
||||
@@ -432,7 +432,7 @@ int chk_perm; /* check permissions when string is looked up*/
|
||||
/*===========================================================================*
|
||||
* get_name *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *get_name(path_name, string)
|
||||
static char *get_name(path_name, string)
|
||||
char *path_name; /* path name to parse */
|
||||
char string[NAME_MAX+1]; /* component extracted from 'old_name' */
|
||||
{
|
||||
@@ -482,7 +482,7 @@ char string[NAME_MAX+1]; /* component extracted from 'old_name' */
|
||||
/*===========================================================================*
|
||||
* search_dir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int search_dir(ldir_ptr, string, numb, flag, check_permissions, ftype)
|
||||
int search_dir(ldir_ptr, string, numb, flag, check_permissions, ftype)
|
||||
register struct inode *ldir_ptr; /* ptr to inode for dir to search */
|
||||
char string[NAME_MAX + 1]; /* component to search for */
|
||||
ino_t *numb; /* pointer to inode number */
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
#include "super.h"
|
||||
#include <minix/vfsif.h>
|
||||
|
||||
FORWARD int in_group(gid_t grp);
|
||||
static int in_group(gid_t grp);
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_chmod *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_chmod()
|
||||
int fs_chmod()
|
||||
{
|
||||
/* Perform the chmod(name, mode) system call. */
|
||||
|
||||
@@ -42,7 +42,7 @@ PUBLIC int fs_chmod()
|
||||
/*===========================================================================*
|
||||
* fs_chown *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_chown()
|
||||
int fs_chown()
|
||||
{
|
||||
register struct inode *rip;
|
||||
register int r;
|
||||
@@ -72,7 +72,7 @@ PUBLIC int fs_chown()
|
||||
/*===========================================================================*
|
||||
* forbidden *
|
||||
*===========================================================================*/
|
||||
PUBLIC int forbidden(register struct inode *rip, mode_t access_desired)
|
||||
int forbidden(register struct inode *rip, mode_t access_desired)
|
||||
{
|
||||
/* Given a pointer to an inode, 'rip', and the access desired, determine
|
||||
* if the access is allowed, and if not why not. The routine looks up the
|
||||
@@ -126,7 +126,7 @@ PUBLIC int forbidden(register struct inode *rip, mode_t access_desired)
|
||||
/*===========================================================================*
|
||||
* in_group *
|
||||
*===========================================================================*/
|
||||
PRIVATE int in_group(gid_t grp)
|
||||
static int in_group(gid_t grp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -144,7 +144,7 @@ PRIVATE int in_group(gid_t grp)
|
||||
/*===========================================================================*
|
||||
* read_only *
|
||||
*===========================================================================*/
|
||||
PUBLIC int read_only(ip)
|
||||
int read_only(ip)
|
||||
struct inode *ip; /* ptr to inode whose file sys is to be cked */
|
||||
{
|
||||
/* Check to see if the file system on which the inode 'ip' resides is mounted
|
||||
|
||||
@@ -16,21 +16,21 @@
|
||||
#include <sys/param.h>
|
||||
|
||||
|
||||
FORWARD struct buf *rahead(struct inode *rip, block_t baseblock, u64_t
|
||||
static struct buf *rahead(struct inode *rip, block_t baseblock, u64_t
|
||||
position, unsigned bytes_ahead);
|
||||
FORWARD int rw_chunk(struct inode *rip, u64_t position, unsigned off,
|
||||
static int rw_chunk(struct inode *rip, u64_t position, unsigned off,
|
||||
size_t chunk, unsigned left, int rw_flag, cp_grant_id_t gid, unsigned
|
||||
buf_off, unsigned int block_size, int *completed);
|
||||
|
||||
PRIVATE char getdents_buf[GETDENTS_BUFSIZ];
|
||||
static char getdents_buf[GETDENTS_BUFSIZ];
|
||||
|
||||
PRIVATE off_t rdahedpos; /* position to read ahead */
|
||||
PRIVATE struct inode *rdahed_inode; /* pointer to inode to read ahead */
|
||||
static off_t rdahedpos; /* position to read ahead */
|
||||
static struct inode *rdahed_inode; /* pointer to inode to read ahead */
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_readwrite *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_readwrite(void)
|
||||
int fs_readwrite(void)
|
||||
{
|
||||
int r, rw_flag, block_spec;
|
||||
int regular;
|
||||
@@ -139,7 +139,7 @@ PUBLIC int fs_readwrite(void)
|
||||
/*===========================================================================*
|
||||
* fs_breadwrite *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_breadwrite(void)
|
||||
int fs_breadwrite(void)
|
||||
{
|
||||
int r, rw_flag, completed;
|
||||
cp_grant_id_t gid;
|
||||
@@ -201,7 +201,7 @@ PUBLIC int fs_breadwrite(void)
|
||||
/*===========================================================================*
|
||||
* rw_chunk *
|
||||
*===========================================================================*/
|
||||
PRIVATE int rw_chunk(rip, position, off, chunk, left, rw_flag, gid,
|
||||
static int rw_chunk(rip, position, off, chunk, left, rw_flag, gid,
|
||||
buf_off, block_size, completed)
|
||||
register struct inode *rip; /* pointer to inode for file to be rd/wr */
|
||||
u64_t position; /* position within file to read or write */
|
||||
@@ -290,7 +290,7 @@ int *completed; /* number of bytes copied */
|
||||
/*===========================================================================*
|
||||
* read_map *
|
||||
*===========================================================================*/
|
||||
PUBLIC block_t read_map(rip, position)
|
||||
block_t read_map(rip, position)
|
||||
register struct inode *rip; /* ptr to inode to map from */
|
||||
off_t position; /* position in file whose blk wanted */
|
||||
{
|
||||
@@ -371,7 +371,7 @@ off_t position; /* position in file whose blk wanted */
|
||||
/*===========================================================================*
|
||||
* rd_indir *
|
||||
*===========================================================================*/
|
||||
PUBLIC block_t rd_indir(bp, index)
|
||||
block_t rd_indir(bp, index)
|
||||
struct buf *bp; /* pointer to indirect block */
|
||||
int index; /* index into *bp */
|
||||
{
|
||||
@@ -385,7 +385,7 @@ int index; /* index into *bp */
|
||||
/*===========================================================================*
|
||||
* read_ahead *
|
||||
*===========================================================================*/
|
||||
PUBLIC void read_ahead()
|
||||
void read_ahead()
|
||||
{
|
||||
/* Read a block into the cache before it is needed. */
|
||||
unsigned int block_size;
|
||||
@@ -411,7 +411,7 @@ PUBLIC void read_ahead()
|
||||
/*===========================================================================*
|
||||
* rahead *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct buf *rahead(rip, baseblock, position, bytes_ahead)
|
||||
static struct buf *rahead(rip, baseblock, position, bytes_ahead)
|
||||
register struct inode *rip; /* pointer to inode for file to be read */
|
||||
block_t baseblock; /* block at current position */
|
||||
u64_t position; /* position within file */
|
||||
@@ -538,7 +538,7 @@ unsigned bytes_ahead; /* bytes beyond position for immediate use */
|
||||
/*===========================================================================*
|
||||
* fs_getdents *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_getdents(void)
|
||||
int fs_getdents(void)
|
||||
{
|
||||
register struct inode *rip;
|
||||
int o, r, done;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/*===========================================================================*
|
||||
* stat_inode *
|
||||
*===========================================================================*/
|
||||
PRIVATE int stat_inode(
|
||||
static int stat_inode(
|
||||
register struct inode *rip, /* pointer to inode to stat */
|
||||
endpoint_t who_e, /* Caller endpoint */
|
||||
cp_grant_id_t gid /* grant for the stat buf */
|
||||
@@ -63,7 +63,7 @@ PRIVATE int stat_inode(
|
||||
/*===========================================================================*
|
||||
* fs_fstatfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_fstatfs()
|
||||
int fs_fstatfs()
|
||||
{
|
||||
struct statfs st;
|
||||
struct inode *rip;
|
||||
@@ -85,7 +85,7 @@ PUBLIC int fs_fstatfs()
|
||||
/*===========================================================================*
|
||||
* fs_stat *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_stat()
|
||||
int fs_stat()
|
||||
{
|
||||
register int r; /* return value */
|
||||
register struct inode *rip; /* target inode */
|
||||
@@ -101,7 +101,7 @@ PUBLIC int fs_stat()
|
||||
/*===========================================================================*
|
||||
* fs_statvfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_statvfs()
|
||||
int fs_statvfs()
|
||||
{
|
||||
struct statvfs st;
|
||||
struct super_block *sp;
|
||||
|
||||
@@ -20,22 +20,22 @@
|
||||
#include "super.h"
|
||||
#include "const.h"
|
||||
|
||||
FORWARD off_t ext2_max_size(int block_size);
|
||||
FORWARD u32_t ext2_count_dirs(struct super_block *sp);
|
||||
static off_t ext2_max_size(int block_size);
|
||||
static u32_t ext2_count_dirs(struct super_block *sp);
|
||||
|
||||
FORWARD void super_copy(register struct super_block *dest, register
|
||||
static void super_copy(register struct super_block *dest, register
|
||||
struct super_block *source);
|
||||
FORWARD void copy_group_descriptors(register struct group_desc
|
||||
static void copy_group_descriptors(register struct group_desc
|
||||
*dest_array, register struct group_desc *source_array, unsigned int
|
||||
ngroups);
|
||||
|
||||
PRIVATE off_t super_block_offset;
|
||||
static off_t super_block_offset;
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* get_super *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct super_block *get_super(
|
||||
struct super_block *get_super(
|
||||
dev_t dev /* device number whose super_block is sought */
|
||||
)
|
||||
{
|
||||
@@ -51,19 +51,19 @@ PUBLIC struct super_block *get_super(
|
||||
/*===========================================================================*
|
||||
* get_block_size *
|
||||
*===========================================================================*/
|
||||
PUBLIC unsigned int get_block_size(dev_t dev)
|
||||
unsigned int get_block_size(dev_t dev)
|
||||
{
|
||||
if (dev == NO_DEV)
|
||||
panic("request for block size of NO_DEV");
|
||||
return(fs_block_size);
|
||||
}
|
||||
|
||||
PRIVATE struct group_desc *ondisk_group_descs;
|
||||
static struct group_desc *ondisk_group_descs;
|
||||
|
||||
/*===========================================================================*
|
||||
* read_super *
|
||||
*===========================================================================*/
|
||||
PUBLIC int read_super(sp)
|
||||
int read_super(sp)
|
||||
register struct super_block *sp; /* pointer to a superblock */
|
||||
{
|
||||
/* Read a superblock. */
|
||||
@@ -214,7 +214,7 @@ register struct super_block *sp; /* pointer to a superblock */
|
||||
/*===========================================================================*
|
||||
* write_super *
|
||||
*===========================================================================*/
|
||||
PUBLIC void write_super(sp)
|
||||
void write_super(sp)
|
||||
struct super_block *sp; /* pointer to a superblock */
|
||||
{
|
||||
/* Write a superblock and gdt. */
|
||||
@@ -271,7 +271,7 @@ struct group_desc* get_group_desc(unsigned int bnum)
|
||||
}
|
||||
|
||||
|
||||
PRIVATE u32_t ext2_count_dirs(struct super_block *sp)
|
||||
static u32_t ext2_count_dirs(struct super_block *sp)
|
||||
{
|
||||
u32_t count = 0;
|
||||
unsigned int i;
|
||||
@@ -302,7 +302,7 @@ PRIVATE u32_t ext2_count_dirs(struct super_block *sp)
|
||||
* Anyway this function is safe for any change.
|
||||
* Note: there is also limitation from VFS (to LONG_MAX, i.e. 2GB).
|
||||
*/
|
||||
PRIVATE off_t ext2_max_size(int block_size)
|
||||
static off_t ext2_max_size(int block_size)
|
||||
{
|
||||
/* 12 is EXT2_NDIR_BLOCKS used in calculations. */
|
||||
if (EXT2_NDIR_BLOCKS != 12)
|
||||
@@ -352,7 +352,7 @@ PRIVATE off_t ext2_max_size(int block_size)
|
||||
/*===========================================================================*
|
||||
* super_copy *
|
||||
*===========================================================================*/
|
||||
PRIVATE void super_copy(
|
||||
static void super_copy(
|
||||
register struct super_block *dest,
|
||||
register struct super_block *source
|
||||
)
|
||||
@@ -411,7 +411,7 @@ PRIVATE void super_copy(
|
||||
/*===========================================================================*
|
||||
* gd_copy *
|
||||
*===========================================================================*/
|
||||
PRIVATE void gd_copy(
|
||||
static void gd_copy(
|
||||
register struct group_desc *dest,
|
||||
register struct group_desc *source
|
||||
)
|
||||
@@ -434,7 +434,7 @@ PRIVATE void gd_copy(
|
||||
/*===========================================================================*
|
||||
* copy_group_descriptors *
|
||||
*===========================================================================*/
|
||||
PRIVATE void copy_group_descriptors(
|
||||
static void copy_group_descriptors(
|
||||
register struct group_desc *dest_array,
|
||||
register struct group_desc *source_array,
|
||||
unsigned int ngroups
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "buf.h"
|
||||
#include "super.h"
|
||||
|
||||
PUBLIC int (*fs_call_vec[])(void) = {
|
||||
int (*fs_call_vec[])(void) = {
|
||||
no_sys, /* 0 not used */
|
||||
no_sys, /* 1 */ /* Was: fs_getnode */
|
||||
fs_putnode, /* 2 */
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_utime *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_utime()
|
||||
int fs_utime()
|
||||
{
|
||||
register struct inode *rip;
|
||||
register int r;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/*===========================================================================*
|
||||
* no_sys *
|
||||
*===========================================================================*/
|
||||
PUBLIC int no_sys()
|
||||
int no_sys()
|
||||
{
|
||||
/* Somebody has used an illegal system call number */
|
||||
printf("no_sys: invalid call %d\n", req_nr);
|
||||
@@ -22,7 +22,7 @@ PUBLIC int no_sys()
|
||||
/*===========================================================================*
|
||||
* conv2 *
|
||||
*===========================================================================*/
|
||||
PUBLIC unsigned conv2(norm, w)
|
||||
unsigned conv2(norm, w)
|
||||
int norm; /* TRUE if no swap, FALSE for byte swap */
|
||||
int w; /* promotion of 16-bit word to be swapped */
|
||||
{
|
||||
@@ -35,7 +35,7 @@ int w; /* promotion of 16-bit word to be swapped */
|
||||
/*===========================================================================*
|
||||
* conv4 *
|
||||
*===========================================================================*/
|
||||
PUBLIC long conv4(norm, x)
|
||||
long conv4(norm, x)
|
||||
int norm; /* TRUE if no swap, FALSE for byte swap */
|
||||
long x; /* 32-bit long to be byte swapped */
|
||||
{
|
||||
@@ -54,7 +54,7 @@ long x; /* 32-bit long to be byte swapped */
|
||||
/*===========================================================================*
|
||||
* clock_time *
|
||||
*===========================================================================*/
|
||||
PUBLIC time_t clock_time()
|
||||
time_t clock_time()
|
||||
{
|
||||
/* This routine returns the time in seconds since 1.1.1970. MINIX is an
|
||||
* astrophysically naive system that assumes the earth rotates at a constant
|
||||
@@ -75,7 +75,7 @@ PUBLIC time_t clock_time()
|
||||
/*===========================================================================*
|
||||
* mfs_min *
|
||||
*===========================================================================*/
|
||||
PUBLIC int min(unsigned int l, unsigned int r)
|
||||
int min(unsigned int l, unsigned int r)
|
||||
{
|
||||
if(r >= l) return(l);
|
||||
|
||||
@@ -86,7 +86,7 @@ PUBLIC int min(unsigned int l, unsigned int r)
|
||||
/*===========================================================================*
|
||||
* mfs_nul *
|
||||
*===========================================================================*/
|
||||
PUBLIC void mfs_nul_f(char *file, int line, char *str, unsigned int len,
|
||||
void mfs_nul_f(char *file, int line, char *str, unsigned int len,
|
||||
unsigned int maxlen)
|
||||
{
|
||||
if(len < maxlen && str[len-1] != '\0') {
|
||||
@@ -102,7 +102,7 @@ PUBLIC void mfs_nul_f(char *file, int line, char *str, unsigned int len,
|
||||
/*===========================================================================*
|
||||
* sanity_check *
|
||||
*===========================================================================*/
|
||||
PUBLIC void sanitycheck(char *file, int line)
|
||||
void sanitycheck(char *file, int line)
|
||||
{
|
||||
MYASSERT(SELF_E > 0);
|
||||
if(superblock->s_dev != NO_DEV) {
|
||||
@@ -116,7 +116,7 @@ PUBLIC void sanitycheck(char *file, int line)
|
||||
/*===========================================================================*
|
||||
* ansi_strcmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC int ansi_strcmp(register const char* ansi_s, register const char *s2,
|
||||
int ansi_strcmp(register const char* ansi_s, register const char *s2,
|
||||
register size_t ansi_s_length)
|
||||
{
|
||||
/* Compare non null-terminated string ansi_s (length=ansi_s_length)
|
||||
@@ -143,7 +143,7 @@ PUBLIC int ansi_strcmp(register const char* ansi_s, register const char *s2,
|
||||
/*===========================================================================*
|
||||
* setbit *
|
||||
*===========================================================================*/
|
||||
PUBLIC bit_t setbit(bitchunk_t *bitmap, bit_t max_bits, unsigned int word)
|
||||
bit_t setbit(bitchunk_t *bitmap, bit_t max_bits, unsigned int word)
|
||||
{
|
||||
/* Find free bit in bitmap and set. Return number of the bit,
|
||||
* if failed return -1.
|
||||
@@ -192,7 +192,7 @@ PUBLIC bit_t setbit(bitchunk_t *bitmap, bit_t max_bits, unsigned int word)
|
||||
/*===========================================================================*
|
||||
* setbyte *
|
||||
*===========================================================================*/
|
||||
PUBLIC bit_t setbyte(bitchunk_t *bitmap, bit_t max_bits, unsigned int word)
|
||||
bit_t setbyte(bitchunk_t *bitmap, bit_t max_bits, unsigned int word)
|
||||
{
|
||||
/* Find free byte in bitmap and set it. Return number of the starting bit,
|
||||
* if failed return -1.
|
||||
@@ -233,7 +233,7 @@ PUBLIC bit_t setbyte(bitchunk_t *bitmap, bit_t max_bits, unsigned int word)
|
||||
/*===========================================================================*
|
||||
* unsetbit *
|
||||
*===========================================================================*/
|
||||
PUBLIC int unsetbit(bitchunk_t *bitmap, bit_t bit)
|
||||
int unsetbit(bitchunk_t *bitmap, bit_t bit)
|
||||
{
|
||||
/* Unset specified bit. If requested bit is already free return -1,
|
||||
* otherwise return 0.
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
#include "inode.h"
|
||||
#include "super.h"
|
||||
|
||||
FORWARD void wr_indir(struct buf *bp, int index, block_t block);
|
||||
FORWARD int empty_indir(struct buf *, struct super_block *);
|
||||
static void wr_indir(struct buf *bp, int index, block_t block);
|
||||
static int empty_indir(struct buf *, struct super_block *);
|
||||
|
||||
/*===========================================================================*
|
||||
* write_map *
|
||||
*===========================================================================*/
|
||||
PUBLIC int write_map(rip, position, new_block, op)
|
||||
int write_map(rip, position, new_block, op)
|
||||
struct inode *rip; /* pointer to inode to be changed */
|
||||
off_t position; /* file address to be mapped */
|
||||
block_t new_block; /* block # to be inserted */
|
||||
@@ -267,7 +267,7 @@ int op; /* special actions */
|
||||
/*===========================================================================*
|
||||
* wr_indir *
|
||||
*===========================================================================*/
|
||||
PRIVATE void wr_indir(bp, index, block)
|
||||
static void wr_indir(bp, index, block)
|
||||
struct buf *bp; /* pointer to indirect block */
|
||||
int index; /* index into *bp */
|
||||
block_t block; /* block to write */
|
||||
@@ -285,7 +285,7 @@ block_t block; /* block to write */
|
||||
/*===========================================================================*
|
||||
* empty_indir *
|
||||
*===========================================================================*/
|
||||
PRIVATE int empty_indir(bp, sb)
|
||||
static int empty_indir(bp, sb)
|
||||
struct buf *bp; /* pointer to indirect block */
|
||||
struct super_block *sb; /* superblock of device block resides on */
|
||||
{
|
||||
@@ -303,7 +303,7 @@ struct super_block *sb; /* superblock of device block resides on */
|
||||
/*===========================================================================*
|
||||
* new_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct buf *new_block(rip, position)
|
||||
struct buf *new_block(rip, position)
|
||||
register struct inode *rip; /* pointer to inode */
|
||||
off_t position; /* file pointer */
|
||||
{
|
||||
@@ -364,7 +364,7 @@ off_t position; /* file pointer */
|
||||
/*===========================================================================*
|
||||
* zero_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC void zero_block(bp)
|
||||
void zero_block(bp)
|
||||
register struct buf *bp; /* pointer to buffer to zero */
|
||||
{
|
||||
/* Zero a block. */
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
|
||||
#include "inc.h"
|
||||
|
||||
PRIVATE LIST_HEAD(hash_head, inode) hash_table[NUM_HASH_SLOTS];
|
||||
static LIST_HEAD(hash_head, inode) hash_table[NUM_HASH_SLOTS];
|
||||
|
||||
FORWARD void del_one_dentry(struct inode *ino);
|
||||
FORWARD unsigned int hash_dentry(struct inode *parent, char *name);
|
||||
static void del_one_dentry(struct inode *ino);
|
||||
static unsigned int hash_dentry(struct inode *parent, char *name);
|
||||
|
||||
/*===========================================================================*
|
||||
* init_dentry *
|
||||
*===========================================================================*/
|
||||
PUBLIC void init_dentry()
|
||||
void init_dentry()
|
||||
{
|
||||
/* Initialize the names hashtable.
|
||||
*/
|
||||
@@ -33,7 +33,7 @@ PUBLIC void init_dentry()
|
||||
/*===========================================================================*
|
||||
* lookup_dentry *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *lookup_dentry(parent, name)
|
||||
struct inode *lookup_dentry(parent, name)
|
||||
struct inode *parent;
|
||||
char *name;
|
||||
{
|
||||
@@ -64,7 +64,7 @@ char *name;
|
||||
/*===========================================================================*
|
||||
* add_dentry *
|
||||
*===========================================================================*/
|
||||
PUBLIC void add_dentry(parent, name, ino)
|
||||
void add_dentry(parent, name, ino)
|
||||
struct inode *parent;
|
||||
char *name;
|
||||
struct inode *ino;
|
||||
@@ -92,7 +92,7 @@ struct inode *ino;
|
||||
/*===========================================================================*
|
||||
* del_one_dentry *
|
||||
*===========================================================================*/
|
||||
PRIVATE void del_one_dentry(ino)
|
||||
static void del_one_dentry(ino)
|
||||
struct inode *ino;
|
||||
{
|
||||
/* This inode has become inaccessible by name. Disassociate it from its parent
|
||||
@@ -123,7 +123,7 @@ struct inode *ino;
|
||||
/*===========================================================================*
|
||||
* del_dentry *
|
||||
*===========================================================================*/
|
||||
PUBLIC void del_dentry(ino)
|
||||
void del_dentry(ino)
|
||||
struct inode *ino;
|
||||
{
|
||||
/* Disassociate an inode from its parent, effectively deleting it. Recursively
|
||||
@@ -167,7 +167,7 @@ struct inode *ino;
|
||||
/*===========================================================================*
|
||||
* hash_dentry *
|
||||
*===========================================================================*/
|
||||
PRIVATE unsigned int hash_dentry(parent, name)
|
||||
static unsigned int hash_dentry(parent, name)
|
||||
struct inode *parent;
|
||||
char *name;
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/*===========================================================================*
|
||||
* get_handle *
|
||||
*===========================================================================*/
|
||||
PUBLIC int get_handle(ino)
|
||||
int get_handle(ino)
|
||||
struct inode *ino;
|
||||
{
|
||||
/* Get an open file or directory handle for an inode.
|
||||
@@ -55,7 +55,7 @@ struct inode *ino;
|
||||
/*===========================================================================*
|
||||
* put_handle *
|
||||
*===========================================================================*/
|
||||
PUBLIC void put_handle(ino)
|
||||
void put_handle(ino)
|
||||
struct inode *ino;
|
||||
{
|
||||
/* Close an open file or directory handle associated with an inode.
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
#include "inc.h"
|
||||
|
||||
PRIVATE struct inode inodes[NUM_INODES];
|
||||
static struct inode inodes[NUM_INODES];
|
||||
|
||||
PRIVATE TAILQ_HEAD(free_head, inode) free_list;
|
||||
static TAILQ_HEAD(free_head, inode) free_list;
|
||||
|
||||
/*===========================================================================*
|
||||
* init_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *init_inode()
|
||||
struct inode *init_inode()
|
||||
{
|
||||
/* Initialize inode table. Return the root inode.
|
||||
*/
|
||||
@@ -65,7 +65,7 @@ PUBLIC struct inode *init_inode()
|
||||
/*===========================================================================*
|
||||
* find_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *find_inode(ino_nr)
|
||||
struct inode *find_inode(ino_nr)
|
||||
ino_t ino_nr;
|
||||
{
|
||||
/* Get an inode based on its inode number. Do not increase its reference count.
|
||||
@@ -102,7 +102,7 @@ ino_t ino_nr;
|
||||
/*===========================================================================*
|
||||
* get_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void get_inode(ino)
|
||||
void get_inode(ino)
|
||||
struct inode *ino;
|
||||
{
|
||||
/* Increase the given inode's reference count. If both reference and link
|
||||
@@ -126,7 +126,7 @@ struct inode *ino;
|
||||
/*===========================================================================*
|
||||
* put_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void put_inode(ino)
|
||||
void put_inode(ino)
|
||||
struct inode *ino;
|
||||
{
|
||||
/* Decrease an inode's reference count. If this count has reached zero, close
|
||||
@@ -166,7 +166,7 @@ struct inode *ino;
|
||||
/*===========================================================================*
|
||||
* link_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void link_inode(parent, ino)
|
||||
void link_inode(parent, ino)
|
||||
struct inode *parent;
|
||||
struct inode *ino;
|
||||
{
|
||||
@@ -187,7 +187,7 @@ struct inode *ino;
|
||||
/*===========================================================================*
|
||||
* unlink_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unlink_inode(ino)
|
||||
void unlink_inode(ino)
|
||||
struct inode *ino;
|
||||
{
|
||||
/* Unlink an inode from its parent. If both reference and link count have
|
||||
@@ -213,7 +213,7 @@ struct inode *ino;
|
||||
/*===========================================================================*
|
||||
* get_free_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *get_free_inode()
|
||||
struct inode *get_free_inode()
|
||||
{
|
||||
/* Return a free inode object (with reference count 1), if available.
|
||||
*/
|
||||
@@ -250,7 +250,7 @@ PUBLIC struct inode *get_free_inode()
|
||||
/*===========================================================================*
|
||||
* have_free_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int have_free_inode()
|
||||
int have_free_inode()
|
||||
{
|
||||
/* Check whether there are any free inodes at the moment. Kind of lame, but
|
||||
* this allows for easier error recovery in some places.
|
||||
@@ -262,7 +262,7 @@ PUBLIC int have_free_inode()
|
||||
/*===========================================================================*
|
||||
* have_used_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int have_used_inode()
|
||||
int have_used_inode()
|
||||
{
|
||||
/* Check whether any inodes are still in use, that is, any of the inodes have
|
||||
* a reference count larger than zero.
|
||||
@@ -279,7 +279,7 @@ PUBLIC int have_used_inode()
|
||||
/*===========================================================================*
|
||||
* do_putnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_putnode()
|
||||
int do_putnode()
|
||||
{
|
||||
/* Decrease an inode's reference count.
|
||||
*/
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
FORWARD int force_remove(char *path, int dir);
|
||||
static int force_remove(char *path, int dir);
|
||||
|
||||
/*===========================================================================*
|
||||
* do_create *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_create()
|
||||
int do_create()
|
||||
{
|
||||
/* Create a new file.
|
||||
*/
|
||||
@@ -128,7 +128,7 @@ PUBLIC int do_create()
|
||||
/*===========================================================================*
|
||||
* do_mkdir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_mkdir()
|
||||
int do_mkdir()
|
||||
{
|
||||
/* Make a new directory.
|
||||
*/
|
||||
@@ -177,7 +177,7 @@ PUBLIC int do_mkdir()
|
||||
/*===========================================================================*
|
||||
* force_remove *
|
||||
*===========================================================================*/
|
||||
PRIVATE int force_remove(path, dir)
|
||||
static int force_remove(path, dir)
|
||||
char *path; /* path to file or directory */
|
||||
int dir; /* TRUE iff directory */
|
||||
{
|
||||
@@ -232,7 +232,7 @@ int dir; /* TRUE iff directory */
|
||||
/*===========================================================================*
|
||||
* do_unlink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_unlink()
|
||||
int do_unlink()
|
||||
{
|
||||
/* Delete a file.
|
||||
*/
|
||||
@@ -279,7 +279,7 @@ PUBLIC int do_unlink()
|
||||
/*===========================================================================*
|
||||
* do_rmdir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_rmdir()
|
||||
int do_rmdir()
|
||||
{
|
||||
/* Remove an empty directory.
|
||||
*/
|
||||
@@ -327,7 +327,7 @@ PUBLIC int do_rmdir()
|
||||
/*===========================================================================*
|
||||
* do_rename *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_rename()
|
||||
int do_rename()
|
||||
{
|
||||
/* Rename a file or directory.
|
||||
*/
|
||||
|
||||
@@ -9,19 +9,19 @@
|
||||
|
||||
#include "inc.h"
|
||||
|
||||
FORWARD int get_mask(vfs_ucred_t *ucred);
|
||||
FORWARD int access_as_dir(struct inode *ino, struct hgfs_attr *attr, int
|
||||
static int get_mask(vfs_ucred_t *ucred);
|
||||
static int access_as_dir(struct inode *ino, struct hgfs_attr *attr, int
|
||||
uid, int mask);
|
||||
FORWARD int next_name(char **ptr, char **start, char name[NAME_MAX+1]);
|
||||
FORWARD int go_up(char path[PATH_MAX], struct inode *ino, struct inode
|
||||
static int next_name(char **ptr, char **start, char name[NAME_MAX+1]);
|
||||
static int go_up(char path[PATH_MAX], struct inode *ino, struct inode
|
||||
**res_ino, struct hgfs_attr *attr);
|
||||
FORWARD int go_down(char path[PATH_MAX], struct inode *ino, char *name,
|
||||
static int go_down(char path[PATH_MAX], struct inode *ino, char *name,
|
||||
struct inode **res_ino, struct hgfs_attr *attr);
|
||||
|
||||
/*===========================================================================*
|
||||
* get_mask *
|
||||
*===========================================================================*/
|
||||
PRIVATE int get_mask(ucred)
|
||||
static int get_mask(ucred)
|
||||
vfs_ucred_t *ucred; /* credentials of the caller */
|
||||
{
|
||||
/* Given the caller's credentials, precompute a search access mask to test
|
||||
@@ -42,7 +42,7 @@ vfs_ucred_t *ucred; /* credentials of the caller */
|
||||
/*===========================================================================*
|
||||
* access_as_dir *
|
||||
*===========================================================================*/
|
||||
PRIVATE int access_as_dir(ino, attr, uid, mask)
|
||||
static int access_as_dir(ino, attr, uid, mask)
|
||||
struct inode *ino; /* the inode to test */
|
||||
struct hgfs_attr *attr; /* attributes of the inode */
|
||||
int uid; /* UID of the caller */
|
||||
@@ -69,7 +69,7 @@ int mask; /* search access mask of the caller */
|
||||
/*===========================================================================*
|
||||
* next_name *
|
||||
*===========================================================================*/
|
||||
PRIVATE int next_name(ptr, start, name)
|
||||
static int next_name(ptr, start, name)
|
||||
char **ptr; /* cursor pointer into path (in, out) */
|
||||
char **start; /* place to store start of name */
|
||||
char name[NAME_MAX+1]; /* place to store name */
|
||||
@@ -102,7 +102,7 @@ char name[NAME_MAX+1]; /* place to store name */
|
||||
/*===========================================================================*
|
||||
* go_up *
|
||||
*===========================================================================*/
|
||||
PRIVATE int go_up(path, ino, res_ino, attr)
|
||||
static int go_up(path, ino, res_ino, attr)
|
||||
char path[PATH_MAX]; /* path to take the last part from */
|
||||
struct inode *ino; /* inode of the current directory */
|
||||
struct inode **res_ino; /* place to store resulting inode */
|
||||
@@ -131,7 +131,7 @@ struct hgfs_attr *attr; /* place to store inode attributes */
|
||||
/*===========================================================================*
|
||||
* go_down *
|
||||
*===========================================================================*/
|
||||
PRIVATE int go_down(path, parent, name, res_ino, attr)
|
||||
static int go_down(path, parent, name, res_ino, attr)
|
||||
char path[PATH_MAX]; /* path to add the name to */
|
||||
struct inode *parent; /* inode of the current directory */
|
||||
char *name; /* name of the directory entry */
|
||||
@@ -190,7 +190,7 @@ struct hgfs_attr *attr; /* place to store inode attributes */
|
||||
/*===========================================================================*
|
||||
* do_lookup *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_lookup()
|
||||
int do_lookup()
|
||||
{
|
||||
/* Resolve a path string to an inode.
|
||||
*/
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
FORWARD void get_work(endpoint_t *who_e);
|
||||
FORWARD void send_reply(int err, int transid);
|
||||
static void get_work(endpoint_t *who_e);
|
||||
static void send_reply(int err, int transid);
|
||||
|
||||
PRIVATE struct optset optset_table[] = {
|
||||
static struct optset optset_table[] = {
|
||||
{ "prefix", OPT_STRING, opt.prefix, sizeof(opt.prefix) },
|
||||
{ "uid", OPT_INT, &opt.uid, 10 },
|
||||
{ "gid", OPT_INT, &opt.gid, 10 },
|
||||
@@ -28,14 +28,14 @@ PRIVATE struct optset optset_table[] = {
|
||||
};
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
FORWARD void sef_cb_signal_handler(int signo);
|
||||
static void sef_local_startup(void);
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
static void sef_cb_signal_handler(int signo);
|
||||
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
{
|
||||
/* Initialize this file server. Called at startup time.
|
||||
*/
|
||||
@@ -74,7 +74,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
/*===========================================================================*
|
||||
* sef_cb_signal_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_cb_signal_handler(int signo)
|
||||
static void sef_cb_signal_handler(int signo)
|
||||
{
|
||||
/* Only check for termination signal, ignore anything else. */
|
||||
if (signo != SIGTERM) return;
|
||||
@@ -94,7 +94,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup(void)
|
||||
static void sef_local_startup(void)
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -111,7 +111,7 @@ PRIVATE void sef_local_startup(void)
|
||||
/*===========================================================================*
|
||||
* main *
|
||||
*===========================================================================*/
|
||||
PUBLIC int main(argc, argv)
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
@@ -166,7 +166,7 @@ char *argv[];
|
||||
/*===========================================================================*
|
||||
* get_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void get_work(who_e)
|
||||
static void get_work(who_e)
|
||||
endpoint_t *who_e;
|
||||
{
|
||||
/* Receive a request message from VFS. Return the request call number.
|
||||
@@ -182,7 +182,7 @@ endpoint_t *who_e;
|
||||
/*===========================================================================*
|
||||
* send_reply *
|
||||
*===========================================================================*/
|
||||
PRIVATE void send_reply(err, transid)
|
||||
static void send_reply(err, transid)
|
||||
int err; /* resulting error code */
|
||||
int transid;
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/*===========================================================================*
|
||||
* do_fstatfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_fstatfs()
|
||||
int do_fstatfs()
|
||||
{
|
||||
/* Retrieve file system statistics.
|
||||
*/
|
||||
@@ -31,7 +31,7 @@ PUBLIC int do_fstatfs()
|
||||
/*===========================================================================*
|
||||
* do_statvfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_statvfs()
|
||||
int do_statvfs()
|
||||
{
|
||||
/* Retrieve file system statistics.
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/*===========================================================================*
|
||||
* do_readsuper *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_readsuper()
|
||||
int do_readsuper()
|
||||
{
|
||||
/* Mount the file system.
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ PUBLIC int do_readsuper()
|
||||
/*===========================================================================*
|
||||
* do_unmount *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_unmount()
|
||||
int do_unmount()
|
||||
{
|
||||
/* Unmount the file system.
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/*===========================================================================*
|
||||
* normalize_name *
|
||||
*===========================================================================*/
|
||||
PUBLIC void normalize_name(dst, src)
|
||||
void normalize_name(dst, src)
|
||||
char dst[NAME_MAX+1];
|
||||
char *src;
|
||||
{
|
||||
@@ -38,7 +38,7 @@ char *src;
|
||||
/*===========================================================================*
|
||||
* compare_name *
|
||||
*===========================================================================*/
|
||||
PUBLIC int compare_name(name1, name2)
|
||||
int compare_name(name1, name2)
|
||||
char *name1;
|
||||
char *name2;
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/*===========================================================================*
|
||||
* make_path *
|
||||
*===========================================================================*/
|
||||
PUBLIC int make_path(path, ino)
|
||||
int make_path(path, ino)
|
||||
char path[PATH_MAX];
|
||||
struct inode *ino;
|
||||
{
|
||||
@@ -68,7 +68,7 @@ struct inode *ino;
|
||||
/*===========================================================================*
|
||||
* push_path *
|
||||
*===========================================================================*/
|
||||
PUBLIC int push_path(path, name)
|
||||
int push_path(path, name)
|
||||
char path[PATH_MAX];
|
||||
char *name;
|
||||
{
|
||||
@@ -92,7 +92,7 @@ char *name;
|
||||
/*===========================================================================*
|
||||
* pop_path *
|
||||
*===========================================================================*/
|
||||
PUBLIC void pop_path(path)
|
||||
void pop_path(path)
|
||||
char path[PATH_MAX];
|
||||
{
|
||||
/* Remove the last component from a path.
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/*===========================================================================*
|
||||
* do_read *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_read()
|
||||
int do_read()
|
||||
{
|
||||
/* Read data from a file.
|
||||
*/
|
||||
@@ -77,7 +77,7 @@ PUBLIC int do_read()
|
||||
/*===========================================================================*
|
||||
* do_getdents *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getdents()
|
||||
int do_getdents()
|
||||
{
|
||||
/* Retrieve directory entries.
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/*===========================================================================*
|
||||
* get_mode *
|
||||
*===========================================================================*/
|
||||
PUBLIC mode_t get_mode(ino, mode)
|
||||
mode_t get_mode(ino, mode)
|
||||
struct inode *ino;
|
||||
int mode;
|
||||
{
|
||||
@@ -39,7 +39,7 @@ int mode;
|
||||
/*===========================================================================*
|
||||
* do_stat *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_stat()
|
||||
int do_stat()
|
||||
{
|
||||
/* Retrieve inode status.
|
||||
*/
|
||||
@@ -102,7 +102,7 @@ PUBLIC int do_stat()
|
||||
/*===========================================================================*
|
||||
* do_chmod *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_chmod()
|
||||
int do_chmod()
|
||||
{
|
||||
/* Change file mode.
|
||||
*/
|
||||
@@ -139,7 +139,7 @@ PUBLIC int do_chmod()
|
||||
/*===========================================================================*
|
||||
* do_utime *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_utime()
|
||||
int do_utime()
|
||||
{
|
||||
/* Set file times.
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#define _TABLE
|
||||
#include "inc.h"
|
||||
|
||||
PUBLIC int (*call_vec[])(void) = {
|
||||
int (*call_vec[])(void) = {
|
||||
no_sys, /* 0 */
|
||||
no_sys, /* 1 getnode */
|
||||
do_putnode, /* 2 putnode */
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/*===========================================================================*
|
||||
* get_name *
|
||||
*===========================================================================*/
|
||||
PUBLIC int get_name(grant, len, name)
|
||||
int get_name(grant, len, name)
|
||||
cp_grant_id_t grant; /* memory grant for the path component */
|
||||
size_t len; /* length of the name, including '\0' */
|
||||
char name[NAME_MAX+1]; /* buffer in which store the result */
|
||||
@@ -43,7 +43,7 @@ char name[NAME_MAX+1]; /* buffer in which store the result */
|
||||
/*===========================================================================*
|
||||
* do_noop *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_noop()
|
||||
int do_noop()
|
||||
{
|
||||
/* Generic handler for no-op system calls.
|
||||
*/
|
||||
@@ -54,7 +54,7 @@ PUBLIC int do_noop()
|
||||
/*===========================================================================*
|
||||
* no_sys *
|
||||
*===========================================================================*/
|
||||
PUBLIC int no_sys()
|
||||
int no_sys()
|
||||
{
|
||||
/* Generic handler for unimplemented system calls.
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/*===========================================================================*
|
||||
* verify_path *
|
||||
*===========================================================================*/
|
||||
PUBLIC int verify_path(path, ino, attr, stale)
|
||||
int verify_path(path, ino, attr, stale)
|
||||
char path[PATH_MAX];
|
||||
struct inode *ino;
|
||||
struct hgfs_attr *attr;
|
||||
@@ -60,7 +60,7 @@ int *stale;
|
||||
/*===========================================================================*
|
||||
* verify_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int verify_inode(ino, path, attr)
|
||||
int verify_inode(ino, path, attr)
|
||||
struct inode *ino; /* inode to verify */
|
||||
char path[PATH_MAX]; /* buffer in which to store the path */
|
||||
struct hgfs_attr *attr; /* buffer for attributes, or NULL */
|
||||
@@ -87,7 +87,7 @@ struct hgfs_attr *attr; /* buffer for attributes, or NULL */
|
||||
/*===========================================================================*
|
||||
* verify_dentry *
|
||||
*===========================================================================*/
|
||||
PUBLIC int verify_dentry(parent, name, path, res_ino)
|
||||
int verify_dentry(parent, name, path, res_ino)
|
||||
struct inode *parent; /* parent inode: the inode to verify */
|
||||
char name[NAME_MAX+1]; /* the given directory entry path component */
|
||||
char path[PATH_MAX]; /* buffer to store the resulting path in */
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
|
||||
#include "inc.h"
|
||||
|
||||
FORWARD int write_file(struct inode *ino, u64_t *posp, size_t *countp,
|
||||
static int write_file(struct inode *ino, u64_t *posp, size_t *countp,
|
||||
cp_grant_id_t *grantp);
|
||||
|
||||
/*===========================================================================*
|
||||
* write_file *
|
||||
*===========================================================================*/
|
||||
PRIVATE int write_file(ino, posp, countp, grantp)
|
||||
static int write_file(ino, posp, countp, grantp)
|
||||
struct inode *ino;
|
||||
u64_t *posp;
|
||||
size_t *countp;
|
||||
@@ -79,7 +79,7 @@ cp_grant_id_t *grantp;
|
||||
/*===========================================================================*
|
||||
* do_write *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_write()
|
||||
int do_write()
|
||||
{
|
||||
/* Write data to a file.
|
||||
*/
|
||||
@@ -116,7 +116,7 @@ PUBLIC int do_write()
|
||||
/*===========================================================================*
|
||||
* do_ftrunc *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_ftrunc()
|
||||
int do_ftrunc()
|
||||
{
|
||||
/* Change file size or create file holes.
|
||||
*/
|
||||
|
||||
@@ -60,53 +60,53 @@ THIS_FILE
|
||||
|
||||
#if BUF512_NR
|
||||
DECLARE_TYPE(buf512, buf512_t, 512);
|
||||
PRIVATE acc_t *buf512_freelist;
|
||||
static acc_t *buf512_freelist;
|
||||
DECLARE_STORAGE(buf512_t, buffers512, BUF512_NR);
|
||||
FORWARD void bf_512free ARGS(( acc_t *acc ));
|
||||
static void bf_512free ARGS(( acc_t *acc ));
|
||||
#endif
|
||||
#if BUF2K_NR
|
||||
DECLARE_TYPE(buf2K, buf2K_t, (2*1024));
|
||||
PRIVATE acc_t *buf2K_freelist;
|
||||
static acc_t *buf2K_freelist;
|
||||
DECLARE_STORAGE(buf2K_t, buffers2K, BUF2K_NR);
|
||||
FORWARD void bf_2Kfree ARGS(( acc_t *acc ));
|
||||
static void bf_2Kfree ARGS(( acc_t *acc ));
|
||||
#endif
|
||||
#if BUF32K_NR
|
||||
DECLARE_TYPE(buf32K, buf32K_t, (32*1024));
|
||||
PRIVATE acc_t *buf32K_freelist;
|
||||
static acc_t *buf32K_freelist;
|
||||
DECLARE_STORAGE(buf32K_t, buffers32K, BUF32K_NR);
|
||||
FORWARD void bf_32Kfree ARGS(( acc_t *acc ));
|
||||
static void bf_32Kfree ARGS(( acc_t *acc ));
|
||||
#endif
|
||||
|
||||
PRIVATE acc_t *acc_freelist;
|
||||
static acc_t *acc_freelist;
|
||||
DECLARE_STORAGE(acc_t, accessors, ACC_NR);
|
||||
|
||||
PRIVATE bf_freereq_t freereq[CLIENT_NR];
|
||||
PRIVATE size_t bf_buf_gran;
|
||||
static bf_freereq_t freereq[CLIENT_NR];
|
||||
static size_t bf_buf_gran;
|
||||
|
||||
PUBLIC size_t bf_free_bufsize;
|
||||
PUBLIC acc_t *bf_temporary_acc;
|
||||
PUBLIC acc_t *bf_linkcheck_acc;
|
||||
size_t bf_free_bufsize;
|
||||
acc_t *bf_temporary_acc;
|
||||
acc_t *bf_linkcheck_acc;
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
int inet_buf_debug;
|
||||
unsigned buf_generation;
|
||||
PRIVATE bf_checkreq_t checkreq[CLIENT_NR];
|
||||
static bf_checkreq_t checkreq[CLIENT_NR];
|
||||
#endif
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
FORWARD acc_t *bf_small_memreq ARGS(( size_t size ));
|
||||
static acc_t *bf_small_memreq ARGS(( size_t size ));
|
||||
#else
|
||||
FORWARD acc_t *_bf_small_memreq ARGS(( char *clnt_file, int clnt_line,
|
||||
static acc_t *_bf_small_memreq ARGS(( char *clnt_file, int clnt_line,
|
||||
size_t size ));
|
||||
#define bf_small_memreq(a) _bf_small_memreq(clnt_file, clnt_line, a)
|
||||
#endif
|
||||
FORWARD void free_accs ARGS(( void ));
|
||||
static void free_accs ARGS(( void ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void count_free_bufs ARGS(( acc_t *list ));
|
||||
FORWARD int report_buffer ARGS(( buf_t *buf, char *label, int i ));
|
||||
static void count_free_bufs ARGS(( acc_t *list ));
|
||||
static int report_buffer ARGS(( buf_t *buf, char *label, int i ));
|
||||
#endif
|
||||
|
||||
PUBLIC void bf_init()
|
||||
void bf_init()
|
||||
{
|
||||
int i;
|
||||
size_t buf_s;
|
||||
@@ -189,10 +189,10 @@ PUBLIC void bf_init()
|
||||
}
|
||||
|
||||
#ifndef BUF_CONSISTENCY_CHECK
|
||||
PUBLIC void bf_logon(func)
|
||||
void bf_logon(func)
|
||||
bf_freereq_t func;
|
||||
#else
|
||||
PUBLIC void bf_logon(func, checkfunc)
|
||||
void bf_logon(func, checkfunc)
|
||||
bf_freereq_t func;
|
||||
bf_checkreq_t checkfunc;
|
||||
#endif
|
||||
@@ -217,9 +217,9 @@ bf_memreq
|
||||
*/
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_memreq(size)
|
||||
acc_t *bf_memreq(size)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_memreq(clnt_file, clnt_line, size)
|
||||
acc_t *_bf_memreq(clnt_file, clnt_line, size)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -322,9 +322,9 @@ bf_small_memreq
|
||||
*/
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PRIVATE acc_t *bf_small_memreq(size)
|
||||
static acc_t *bf_small_memreq(size)
|
||||
#else
|
||||
PRIVATE acc_t *_bf_small_memreq(clnt_file, clnt_line, size)
|
||||
static acc_t *_bf_small_memreq(clnt_file, clnt_line, size)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -334,9 +334,9 @@ size_t size;
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC void bf_afree(acc)
|
||||
void bf_afree(acc)
|
||||
#else
|
||||
PUBLIC void _bf_afree(clnt_file, clnt_line, acc)
|
||||
void _bf_afree(clnt_file, clnt_line, acc)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -401,9 +401,9 @@ acc_t *acc;
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_dupacc(acc_ptr)
|
||||
acc_t *bf_dupacc(acc_ptr)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_dupacc(clnt_file, clnt_line, acc_ptr)
|
||||
acc_t *_bf_dupacc(clnt_file, clnt_line, acc_ptr)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -433,7 +433,7 @@ register acc_t *acc_ptr;
|
||||
return new_acc;
|
||||
}
|
||||
|
||||
PUBLIC size_t bf_bufsize(acc_ptr)
|
||||
size_t bf_bufsize(acc_ptr)
|
||||
register acc_t *acc_ptr;
|
||||
{
|
||||
register size_t size;
|
||||
@@ -452,9 +452,9 @@ assert(acc_ptr >= accessors && acc_ptr <= &accessors[ACC_NR-1]);
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_packIffLess(pack, min_len)
|
||||
acc_t *bf_packIffLess(pack, min_len)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_packIffLess(clnt_file, clnt_line, pack, min_len)
|
||||
acc_t *_bf_packIffLess(clnt_file, clnt_line, pack, min_len)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -474,9 +474,9 @@ int min_len;
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_pack(old_acc)
|
||||
acc_t *bf_pack(old_acc)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_pack(clnt_file, clnt_line, old_acc)
|
||||
acc_t *_bf_pack(clnt_file, clnt_line, old_acc)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -532,9 +532,9 @@ acc_t *old_acc;
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_cut (data, offset, length)
|
||||
acc_t *bf_cut (data, offset, length)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_cut (clnt_file, clnt_line, data, offset, length)
|
||||
acc_t *_bf_cut (clnt_file, clnt_line, data, offset, length)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -614,9 +614,9 @@ register unsigned length;
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_delhead (data, offset)
|
||||
acc_t *bf_delhead (data, offset)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_delhead (clnt_file, clnt_line, data, offset)
|
||||
acc_t *_bf_delhead (clnt_file, clnt_line, data, offset)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -668,9 +668,9 @@ bf_append
|
||||
*/
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_append(data_first, data_second)
|
||||
acc_t *bf_append(data_first, data_second)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_append(clnt_file, clnt_line, data_first, data_second)
|
||||
acc_t *_bf_append(clnt_file, clnt_line, data_first, data_second)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -818,7 +818,7 @@ assert (offset_old < data_second->acc_length);
|
||||
}
|
||||
|
||||
#if BUF512_NR
|
||||
PRIVATE void bf_512free(acc)
|
||||
static void bf_512free(acc)
|
||||
acc_t *acc;
|
||||
{
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
@@ -830,7 +830,7 @@ acc_t *acc;
|
||||
}
|
||||
#endif
|
||||
#if BUF2K_NR
|
||||
PRIVATE void bf_2Kfree(acc)
|
||||
static void bf_2Kfree(acc)
|
||||
acc_t *acc;
|
||||
{
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
@@ -842,7 +842,7 @@ acc_t *acc;
|
||||
}
|
||||
#endif
|
||||
#if BUF32K_NR
|
||||
PRIVATE void bf_32Kfree(acc)
|
||||
static void bf_32Kfree(acc)
|
||||
acc_t *acc;
|
||||
{
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
@@ -855,7 +855,7 @@ acc_t *acc;
|
||||
#endif
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PUBLIC int bf_consistency_check()
|
||||
int bf_consistency_check()
|
||||
{
|
||||
acc_t *acc;
|
||||
int silent;
|
||||
@@ -980,7 +980,7 @@ PUBLIC int bf_consistency_check()
|
||||
return !error;
|
||||
}
|
||||
|
||||
PRIVATE void count_free_bufs(list)
|
||||
static void count_free_bufs(list)
|
||||
acc_t *list;
|
||||
{
|
||||
acc_t *acc;
|
||||
@@ -1011,7 +1011,7 @@ acc_t *list;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int report_buffer(buf, label, i)
|
||||
static int report_buffer(buf, label, i)
|
||||
buf_t *buf;
|
||||
char *label;
|
||||
int i;
|
||||
@@ -1047,7 +1047,7 @@ int i;
|
||||
return 1;
|
||||
}
|
||||
|
||||
PUBLIC void bf_check_acc(acc)
|
||||
void bf_check_acc(acc)
|
||||
acc_t *acc;
|
||||
{
|
||||
buf_t *buf;
|
||||
@@ -1081,7 +1081,7 @@ acc_t *acc;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void _bf_mark_1acc(clnt_file, clnt_line, acc)
|
||||
void _bf_mark_1acc(clnt_file, clnt_line, acc)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
acc_t *acc;
|
||||
@@ -1090,7 +1090,7 @@ acc_t *acc;
|
||||
acc->acc_alloc_line= clnt_line;
|
||||
}
|
||||
|
||||
PUBLIC void _bf_mark_acc(clnt_file, clnt_line, acc)
|
||||
void _bf_mark_acc(clnt_file, clnt_line, acc)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
acc_t *acc;
|
||||
@@ -1108,7 +1108,7 @@ acc_t *acc;
|
||||
}
|
||||
#endif
|
||||
|
||||
PUBLIC int bf_linkcheck(acc)
|
||||
int bf_linkcheck(acc)
|
||||
acc_t *acc;
|
||||
{
|
||||
int i;
|
||||
@@ -1163,7 +1163,7 @@ acc_t *acc;
|
||||
return 1;
|
||||
}
|
||||
|
||||
PRIVATE void free_accs()
|
||||
static void free_accs()
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@@ -1190,9 +1190,9 @@ assert(bf_linkcheck(bf_linkcheck_acc));
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_align(acc, size, alignment)
|
||||
acc_t *bf_align(acc, size, alignment)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_align(clnt_file, clnt_line, acc, size, alignment)
|
||||
acc_t *_bf_align(clnt_file, clnt_line, acc, size, alignment)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
|
||||
@@ -12,17 +12,17 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
PUBLIC int clck_call_expire;
|
||||
int clck_call_expire;
|
||||
|
||||
PRIVATE time_t curr_time;
|
||||
PRIVATE time_t prev_time;
|
||||
PRIVATE timer_t *timer_chain;
|
||||
PRIVATE time_t next_timeout;
|
||||
static time_t curr_time;
|
||||
static time_t prev_time;
|
||||
static timer_t *timer_chain;
|
||||
static time_t next_timeout;
|
||||
|
||||
FORWARD void clck_fast_release(timer_t *timer);
|
||||
FORWARD void set_timer(void);
|
||||
static void clck_fast_release(timer_t *timer);
|
||||
static void set_timer(void);
|
||||
|
||||
PUBLIC void clck_init()
|
||||
void clck_init()
|
||||
{
|
||||
clck_call_expire= 0;
|
||||
curr_time= 0;
|
||||
@@ -31,7 +31,7 @@ PUBLIC void clck_init()
|
||||
timer_chain= 0;
|
||||
}
|
||||
|
||||
PUBLIC time_t get_time()
|
||||
time_t get_time()
|
||||
{
|
||||
if (!curr_time)
|
||||
{
|
||||
@@ -42,7 +42,7 @@ PUBLIC time_t get_time()
|
||||
return curr_time;
|
||||
}
|
||||
|
||||
PUBLIC void set_time (tim)
|
||||
void set_time (tim)
|
||||
time_t tim;
|
||||
{
|
||||
if (!curr_time && tim >= prev_time)
|
||||
@@ -59,13 +59,13 @@ time_t tim;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void reset_time()
|
||||
void reset_time()
|
||||
{
|
||||
prev_time= curr_time;
|
||||
curr_time= 0;
|
||||
}
|
||||
|
||||
PUBLIC void clck_timer(timer, timeout, func, fd)
|
||||
void clck_timer(timer, timeout, func, fd)
|
||||
timer_t *timer;
|
||||
time_t timeout;
|
||||
timer_func_t func;
|
||||
@@ -103,14 +103,14 @@ int fd;
|
||||
set_timer();
|
||||
}
|
||||
|
||||
PUBLIC void clck_tick (mess)
|
||||
void clck_tick (mess)
|
||||
message *mess;
|
||||
{
|
||||
next_timeout= 0;
|
||||
set_timer();
|
||||
}
|
||||
|
||||
PRIVATE void clck_fast_release (timer)
|
||||
static void clck_fast_release (timer)
|
||||
timer_t *timer;
|
||||
{
|
||||
timer_t *timer_index;
|
||||
@@ -131,7 +131,7 @@ timer_t *timer;
|
||||
timer->tim_active= 0;
|
||||
}
|
||||
|
||||
PRIVATE void set_timer()
|
||||
static void set_timer()
|
||||
{
|
||||
time_t new_time;
|
||||
time_t curr_time;
|
||||
@@ -157,14 +157,14 @@ PRIVATE void set_timer()
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void clck_untimer (timer)
|
||||
void clck_untimer (timer)
|
||||
timer_t *timer;
|
||||
{
|
||||
clck_fast_release (timer);
|
||||
set_timer();
|
||||
}
|
||||
|
||||
PUBLIC void clck_expire_timers()
|
||||
void clck_expire_timers()
|
||||
{
|
||||
time_t curr_time;
|
||||
timer_t *timer_index;
|
||||
|
||||
@@ -125,36 +125,36 @@ typedef struct arp_cache
|
||||
#define ACS_VALID 2
|
||||
#define ACS_UNREACHABLE 3
|
||||
|
||||
PRIVATE struct arp_hash_ent
|
||||
static struct arp_hash_ent
|
||||
{
|
||||
arp_cache_t *ahe_row[ARP_HASH_WIDTH];
|
||||
} arp_hash[ARP_HASH_NR];
|
||||
|
||||
PRIVATE arp_port_t *arp_port_table;
|
||||
PRIVATE arp_cache_t *arp_cache;
|
||||
PRIVATE int arp_cache_nr;
|
||||
static arp_port_t *arp_port_table;
|
||||
static arp_cache_t *arp_cache;
|
||||
static int arp_cache_nr;
|
||||
|
||||
FORWARD acc_t *arp_getdata ARGS(( int fd, size_t offset,
|
||||
static acc_t *arp_getdata ARGS(( int fd, size_t offset,
|
||||
size_t count, int for_ioctl ));
|
||||
FORWARD int arp_putdata ARGS(( int fd, size_t offset,
|
||||
static int arp_putdata ARGS(( int fd, size_t offset,
|
||||
acc_t *data, int for_ioctl ));
|
||||
FORWARD void arp_main ARGS(( arp_port_t *arp_port ));
|
||||
FORWARD void arp_timeout ARGS(( int ref, timer_t *timer ));
|
||||
FORWARD void setup_write ARGS(( arp_port_t *arp_port ));
|
||||
FORWARD void setup_read ARGS(( arp_port_t *arp_port ));
|
||||
FORWARD void do_reclist ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
FORWARD void process_arp_pkt ARGS(( arp_port_t *arp_port, acc_t *data ));
|
||||
FORWARD void client_reply ARGS(( arp_port_t *arp_port,
|
||||
static void arp_main ARGS(( arp_port_t *arp_port ));
|
||||
static void arp_timeout ARGS(( int ref, timer_t *timer ));
|
||||
static void setup_write ARGS(( arp_port_t *arp_port ));
|
||||
static void setup_read ARGS(( arp_port_t *arp_port ));
|
||||
static void do_reclist ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
static void process_arp_pkt ARGS(( arp_port_t *arp_port, acc_t *data ));
|
||||
static void client_reply ARGS(( arp_port_t *arp_port,
|
||||
ipaddr_t ipaddr, ether_addr_t *ethaddr ));
|
||||
FORWARD arp_cache_t *find_cache_ent ARGS(( arp_port_t *arp_port,
|
||||
static arp_cache_t *find_cache_ent ARGS(( arp_port_t *arp_port,
|
||||
ipaddr_t ipaddr ));
|
||||
FORWARD arp_cache_t *alloc_cache_ent ARGS(( int flags ));
|
||||
FORWARD void arp_buffree ARGS(( int priority ));
|
||||
static arp_cache_t *alloc_cache_ent ARGS(( int flags ));
|
||||
static void arp_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void arp_bufcheck ARGS(( void ));
|
||||
static void arp_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
|
||||
PUBLIC void arp_prep()
|
||||
void arp_prep()
|
||||
{
|
||||
arp_port_table= alloc(eth_conf_nr * sizeof(arp_port_table[0]));
|
||||
|
||||
@@ -168,7 +168,7 @@ PUBLIC void arp_prep()
|
||||
arp_cache= alloc(arp_cache_nr * sizeof(arp_cache[0]));
|
||||
}
|
||||
|
||||
PUBLIC void arp_init()
|
||||
void arp_init()
|
||||
{
|
||||
arp_port_t *arp_port;
|
||||
arp_cache_t *cache;
|
||||
@@ -200,7 +200,7 @@ PUBLIC void arp_init()
|
||||
#endif
|
||||
}
|
||||
|
||||
PRIVATE void arp_main(arp_port)
|
||||
static void arp_main(arp_port)
|
||||
arp_port_t *arp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -264,7 +264,7 @@ arp_port_t *arp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE acc_t *arp_getdata (fd, offset, count, for_ioctl)
|
||||
static acc_t *arp_getdata (fd, offset, count, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
size_t count;
|
||||
@@ -345,7 +345,7 @@ int for_ioctl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int arp_putdata (fd, offset, data, for_ioctl)
|
||||
static int arp_putdata (fd, offset, data, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -445,7 +445,7 @@ int for_ioctl;
|
||||
return EGENERIC;
|
||||
}
|
||||
|
||||
PRIVATE void setup_read(arp_port)
|
||||
static void setup_read(arp_port)
|
||||
arp_port_t *arp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -465,7 +465,7 @@ arp_port_t *arp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void setup_write(arp_port)
|
||||
static void setup_write(arp_port)
|
||||
arp_port_t *arp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -510,7 +510,7 @@ arp_port_t *arp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void do_reclist(ev, ev_arg)
|
||||
static void do_reclist(ev, ev_arg)
|
||||
event_t *ev;
|
||||
ev_arg_t ev_arg;
|
||||
{
|
||||
@@ -528,7 +528,7 @@ ev_arg_t ev_arg;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void process_arp_pkt (arp_port, data)
|
||||
static void process_arp_pkt (arp_port, data)
|
||||
arp_port_t *arp_port;
|
||||
acc_t *data;
|
||||
{
|
||||
@@ -690,7 +690,7 @@ acc_t *data;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void client_reply (arp_port, ipaddr, ethaddr)
|
||||
static void client_reply (arp_port, ipaddr, ethaddr)
|
||||
arp_port_t *arp_port;
|
||||
ipaddr_t ipaddr;
|
||||
ether_addr_t *ethaddr;
|
||||
@@ -698,7 +698,7 @@ ether_addr_t *ethaddr;
|
||||
(*arp_port->ap_arp_func)(arp_port->ap_ip_port, ipaddr, ethaddr);
|
||||
}
|
||||
|
||||
PRIVATE arp_cache_t *find_cache_ent (arp_port, ipaddr)
|
||||
static arp_cache_t *find_cache_ent (arp_port, ipaddr)
|
||||
arp_port_t *arp_port;
|
||||
ipaddr_t ipaddr;
|
||||
{
|
||||
@@ -747,7 +747,7 @@ ipaddr_t ipaddr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE arp_cache_t *alloc_cache_ent(flags)
|
||||
static arp_cache_t *alloc_cache_ent(flags)
|
||||
int flags;
|
||||
{
|
||||
arp_cache_t *cache, *old;
|
||||
@@ -812,7 +812,7 @@ int flags;
|
||||
return old;
|
||||
}
|
||||
|
||||
PUBLIC void arp_set_ipaddr (eth_port, ipaddr)
|
||||
void arp_set_ipaddr (eth_port, ipaddr)
|
||||
int eth_port;
|
||||
ipaddr_t ipaddr;
|
||||
{
|
||||
@@ -829,7 +829,7 @@ ipaddr_t ipaddr;
|
||||
arp_main(arp_port);
|
||||
}
|
||||
|
||||
PUBLIC int arp_set_cb(eth_port, ip_port, arp_func)
|
||||
int arp_set_cb(eth_port, ip_port, arp_func)
|
||||
int eth_port;
|
||||
int ip_port;
|
||||
arp_func_t arp_func;
|
||||
@@ -862,7 +862,7 @@ arp_func_t arp_func;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int arp_ip_eth (eth_port, ipaddr, ethaddr)
|
||||
int arp_ip_eth (eth_port, ipaddr, ethaddr)
|
||||
int eth_port;
|
||||
ipaddr_t ipaddr;
|
||||
ether_addr_t *ethaddr;
|
||||
@@ -960,7 +960,7 @@ ether_addr_t *ethaddr;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PUBLIC int arp_ioctl (eth_port, fd, req, get_userdata, put_userdata)
|
||||
int arp_ioctl (eth_port, fd, req, get_userdata, put_userdata)
|
||||
int eth_port;
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
@@ -1191,7 +1191,7 @@ put_userdata_t put_userdata;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void arp_timeout (ref, timer)
|
||||
static void arp_timeout (ref, timer)
|
||||
int ref;
|
||||
timer_t *timer;
|
||||
{
|
||||
@@ -1273,7 +1273,7 @@ timer_t *timer;
|
||||
arp_timeout, ref);
|
||||
}
|
||||
|
||||
PRIVATE void arp_buffree(priority)
|
||||
static void arp_buffree(priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -1334,7 +1334,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void arp_bufcheck()
|
||||
static void arp_bufcheck()
|
||||
{
|
||||
int i;
|
||||
arp_port_t *arp_port;
|
||||
|
||||
@@ -60,35 +60,35 @@ typedef struct
|
||||
u16_t vh_vlan;
|
||||
} vlan_hdr_t;
|
||||
|
||||
FORWARD int eth_checkopt ARGS(( eth_fd_t *eth_fd ));
|
||||
FORWARD void hash_fd ARGS(( eth_fd_t *eth_fd ));
|
||||
FORWARD void unhash_fd ARGS(( eth_fd_t *eth_fd ));
|
||||
FORWARD void eth_buffree ARGS(( int priority ));
|
||||
static int eth_checkopt ARGS(( eth_fd_t *eth_fd ));
|
||||
static void hash_fd ARGS(( eth_fd_t *eth_fd ));
|
||||
static void unhash_fd ARGS(( eth_fd_t *eth_fd ));
|
||||
static void eth_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void eth_bufcheck ARGS(( void ));
|
||||
static void eth_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
FORWARD int eth_sel_read ARGS(( eth_fd_t * ));
|
||||
FORWARD void packet2user ARGS(( eth_fd_t *fd, acc_t *pack, time_t exp_time ));
|
||||
FORWARD void reply_thr_get ARGS(( eth_fd_t *eth_fd,
|
||||
static int eth_sel_read ARGS(( eth_fd_t * ));
|
||||
static void packet2user ARGS(( eth_fd_t *fd, acc_t *pack, time_t exp_time ));
|
||||
static void reply_thr_get ARGS(( eth_fd_t *eth_fd,
|
||||
size_t result, int for_ioctl ));
|
||||
FORWARD void reply_thr_put ARGS(( eth_fd_t *eth_fd,
|
||||
static void reply_thr_put ARGS(( eth_fd_t *eth_fd,
|
||||
size_t result, int for_ioctl ));
|
||||
FORWARD void do_rec_conf ARGS(( eth_port_t *eth_port ));
|
||||
FORWARD u32_t compute_rec_conf ARGS(( eth_port_t *eth_port ));
|
||||
FORWARD acc_t *insert_vlan_hdr ARGS(( eth_port_t *eth_port, acc_t *pack ));
|
||||
static void do_rec_conf ARGS(( eth_port_t *eth_port ));
|
||||
static u32_t compute_rec_conf ARGS(( eth_port_t *eth_port ));
|
||||
static acc_t *insert_vlan_hdr ARGS(( eth_port_t *eth_port, acc_t *pack ));
|
||||
|
||||
PUBLIC eth_port_t *eth_port_table;
|
||||
PUBLIC int no_ethWritePort= 0;
|
||||
eth_port_t *eth_port_table;
|
||||
int no_ethWritePort= 0;
|
||||
|
||||
PRIVATE eth_fd_t eth_fd_table[ETH_FD_NR];
|
||||
PRIVATE ether_addr_t broadcast= { { 255, 255, 255, 255, 255, 255 } };
|
||||
static eth_fd_t eth_fd_table[ETH_FD_NR];
|
||||
static ether_addr_t broadcast= { { 255, 255, 255, 255, 255, 255 } };
|
||||
|
||||
PUBLIC void eth_prep()
|
||||
void eth_prep()
|
||||
{
|
||||
eth_port_table= alloc(eth_conf_nr * sizeof(eth_port_table[0]));
|
||||
}
|
||||
|
||||
PUBLIC void eth_init()
|
||||
void eth_init()
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@@ -123,7 +123,7 @@ PUBLIC void eth_init()
|
||||
osdep_eth_init();
|
||||
}
|
||||
|
||||
PUBLIC int eth_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
int eth_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port, srfd;
|
||||
get_userdata_t get_userdata;
|
||||
@@ -165,7 +165,7 @@ select_res_t select_res;
|
||||
return i;
|
||||
}
|
||||
|
||||
PUBLIC int eth_ioctl(fd, req)
|
||||
int eth_ioctl(fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -416,7 +416,7 @@ printf("eth_ioctl: setting etp_getstat in port %d to %p\n",
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int eth_write(fd, count)
|
||||
int eth_write(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -479,7 +479,7 @@ size_t count;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int eth_send(fd, data, data_len)
|
||||
int eth_send(fd, data, data_len)
|
||||
int fd;
|
||||
acc_t *data;
|
||||
size_t data_len;
|
||||
@@ -564,7 +564,7 @@ size_t data_len;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int eth_read (fd, count)
|
||||
int eth_read (fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -602,7 +602,7 @@ size_t count;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PUBLIC int eth_cancel(fd, which_operation)
|
||||
int eth_cancel(fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -654,7 +654,7 @@ int which_operation;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int eth_select(fd, operations)
|
||||
int eth_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -685,7 +685,7 @@ unsigned operations;
|
||||
return resops;
|
||||
}
|
||||
|
||||
PUBLIC void eth_close(fd)
|
||||
void eth_close(fd)
|
||||
int fd;
|
||||
{
|
||||
eth_fd_t *eth_fd;
|
||||
@@ -711,7 +711,7 @@ int fd;
|
||||
do_rec_conf(eth_port);
|
||||
}
|
||||
|
||||
PUBLIC void eth_loop_ev(ev, ev_arg)
|
||||
void eth_loop_ev(ev, ev_arg)
|
||||
event_t *ev;
|
||||
ev_arg_t ev_arg;
|
||||
{
|
||||
@@ -733,7 +733,7 @@ ev_arg_t ev_arg;
|
||||
eth_restart_write(eth_port);
|
||||
}
|
||||
|
||||
PRIVATE int eth_checkopt (eth_fd)
|
||||
static int eth_checkopt (eth_fd)
|
||||
eth_fd_t *eth_fd;
|
||||
{
|
||||
/* bug: we don't check access modes yet */
|
||||
@@ -769,7 +769,7 @@ eth_fd_t *eth_fd;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void hash_fd(eth_fd)
|
||||
static void hash_fd(eth_fd)
|
||||
eth_fd_t *eth_fd;
|
||||
{
|
||||
eth_port_t *eth_port;
|
||||
@@ -792,7 +792,7 @@ eth_fd_t *eth_fd;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void unhash_fd(eth_fd)
|
||||
static void unhash_fd(eth_fd)
|
||||
eth_fd_t *eth_fd;
|
||||
{
|
||||
eth_port_t *eth_port;
|
||||
@@ -825,7 +825,7 @@ eth_fd_t *eth_fd;
|
||||
*eth_fd_p= curr->ef_type_next;
|
||||
}
|
||||
|
||||
PUBLIC void eth_restart_write(eth_port)
|
||||
void eth_restart_write(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
eth_fd_t *eth_fd;
|
||||
@@ -845,7 +845,7 @@ eth_port_t *eth_port;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void eth_arrive (eth_port, pack, pack_size)
|
||||
void eth_arrive (eth_port, pack, pack_size)
|
||||
eth_port_t *eth_port;
|
||||
acc_t *pack;
|
||||
size_t pack_size;
|
||||
@@ -1031,7 +1031,7 @@ size_t pack_size;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void eth_reg_vlan(eth_port, vlan_port)
|
||||
void eth_reg_vlan(eth_port, vlan_port)
|
||||
eth_port_t *eth_port;
|
||||
eth_port_t *vlan_port;
|
||||
{
|
||||
@@ -1044,7 +1044,7 @@ eth_port_t *vlan_port;
|
||||
eth_port->etp_vlan_tab[h]= vlan_port;
|
||||
}
|
||||
|
||||
PUBLIC void eth_restart_ioctl(eth_port)
|
||||
void eth_restart_ioctl(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
int i, r;
|
||||
@@ -1111,7 +1111,7 @@ printf("eth_restart_ioctl: clearing etp_getstat in port %d\n",
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int eth_sel_read (eth_fd)
|
||||
static int eth_sel_read (eth_fd)
|
||||
eth_fd_t *eth_fd;
|
||||
{
|
||||
acc_t *tmp_acc, *next_acc;
|
||||
@@ -1136,7 +1136,7 @@ eth_fd_t *eth_fd;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void packet2user (eth_fd, pack, exp_time)
|
||||
static void packet2user (eth_fd, pack, exp_time)
|
||||
eth_fd_t *eth_fd;
|
||||
acc_t *pack;
|
||||
time_t exp_time;
|
||||
@@ -1196,7 +1196,7 @@ time_t exp_time;
|
||||
reply_thr_put(eth_fd, result, FALSE);
|
||||
}
|
||||
|
||||
PRIVATE void eth_buffree (priority)
|
||||
static void eth_buffree (priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -1231,7 +1231,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void eth_bufcheck()
|
||||
static void eth_bufcheck()
|
||||
{
|
||||
int i;
|
||||
eth_fd_t *eth_fd;
|
||||
@@ -1253,7 +1253,7 @@ PRIVATE void eth_bufcheck()
|
||||
}
|
||||
#endif
|
||||
|
||||
PRIVATE void do_rec_conf(eth_port)
|
||||
static void do_rec_conf(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
int i;
|
||||
@@ -1276,7 +1276,7 @@ eth_port_t *eth_port;
|
||||
eth_set_rec_conf(eth_port, flags);
|
||||
}
|
||||
|
||||
PRIVATE u32_t compute_rec_conf(eth_port)
|
||||
static u32_t compute_rec_conf(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
eth_fd_t *eth_fd;
|
||||
@@ -1298,7 +1298,7 @@ eth_port_t *eth_port;
|
||||
return flags;
|
||||
}
|
||||
|
||||
PRIVATE void reply_thr_get (eth_fd, result, for_ioctl)
|
||||
static void reply_thr_get (eth_fd, result, for_ioctl)
|
||||
eth_fd_t *eth_fd;
|
||||
size_t result;
|
||||
int for_ioctl;
|
||||
@@ -1309,7 +1309,7 @@ int for_ioctl;
|
||||
assert (!data);
|
||||
}
|
||||
|
||||
PRIVATE void reply_thr_put (eth_fd, result, for_ioctl)
|
||||
static void reply_thr_put (eth_fd, result, for_ioctl)
|
||||
eth_fd_t *eth_fd;
|
||||
size_t result;
|
||||
int for_ioctl;
|
||||
@@ -1321,7 +1321,7 @@ int for_ioctl;
|
||||
assert(error == NW_OK);
|
||||
}
|
||||
|
||||
PRIVATE acc_t *insert_vlan_hdr(eth_port, pack)
|
||||
static acc_t *insert_vlan_hdr(eth_port, pack)
|
||||
eth_port_t *eth_port;
|
||||
acc_t *pack;
|
||||
{
|
||||
|
||||
@@ -47,50 +47,50 @@ typedef struct icmp_port
|
||||
#define ICPS_MAIN 2
|
||||
#define ICPS_ERROR 3
|
||||
|
||||
PRIVATE icmp_port_t *icmp_port_table;
|
||||
static icmp_port_t *icmp_port_table;
|
||||
|
||||
FORWARD void icmp_main ARGS(( icmp_port_t *icmp_port ));
|
||||
FORWARD acc_t *icmp_getdata ARGS(( int port, size_t offset,
|
||||
static void icmp_main ARGS(( icmp_port_t *icmp_port ));
|
||||
static acc_t *icmp_getdata ARGS(( int port, size_t offset,
|
||||
size_t count, int for_ioctl ));
|
||||
FORWARD int icmp_putdata ARGS(( int port, size_t offset,
|
||||
static int icmp_putdata ARGS(( int port, size_t offset,
|
||||
acc_t *data, int for_ioctl ));
|
||||
FORWARD void icmp_read ARGS(( icmp_port_t *icmp_port ));
|
||||
FORWARD void process_data ARGS(( icmp_port_t *icmp_port,
|
||||
static void icmp_read ARGS(( icmp_port_t *icmp_port ));
|
||||
static void process_data ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *data ));
|
||||
FORWARD u16_t icmp_pack_oneCsum ARGS(( acc_t *ip_pack ));
|
||||
FORWARD void icmp_echo_request ARGS(( icmp_port_t *icmp_port,
|
||||
static u16_t icmp_pack_oneCsum ARGS(( acc_t *ip_pack ));
|
||||
static void icmp_echo_request ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *ip_pack, int ip_hdr_len, ip_hdr_t *ip_hdr,
|
||||
acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr ));
|
||||
FORWARD void icmp_dst_unreach ARGS(( icmp_port_t *icmp_port,
|
||||
static void icmp_dst_unreach ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *ip_pack, int ip_hdr_len, ip_hdr_t *ip_hdr,
|
||||
acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr ));
|
||||
FORWARD void icmp_time_exceeded ARGS(( icmp_port_t *icmp_port,
|
||||
static void icmp_time_exceeded ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *ip_pack, int ip_hdr_len, ip_hdr_t *ip_hdr,
|
||||
acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr ));
|
||||
FORWARD void icmp_router_advertisement ARGS(( icmp_port_t *icmp_port,
|
||||
static void icmp_router_advertisement ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr ));
|
||||
FORWARD void icmp_redirect ARGS(( icmp_port_t *icmp_port,
|
||||
static void icmp_redirect ARGS(( icmp_port_t *icmp_port,
|
||||
ip_hdr_t *ip_hdr, acc_t *icmp_pack, int icmp_len,
|
||||
icmp_hdr_t *icmp_hdr ));
|
||||
FORWARD acc_t *make_repl_ip ARGS(( ip_hdr_t *ip_hdr,
|
||||
static acc_t *make_repl_ip ARGS(( ip_hdr_t *ip_hdr,
|
||||
int ip_len ));
|
||||
FORWARD void enqueue_pack ARGS(( icmp_port_t *icmp_port,
|
||||
static void enqueue_pack ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *reply_ip_hdr ));
|
||||
FORWARD int icmp_rate_limit ARGS(( icmp_port_t *icmp_port,
|
||||
static int icmp_rate_limit ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *reply_ip_hdr ));
|
||||
FORWARD void icmp_write ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
FORWARD void icmp_buffree ARGS(( int priority ));
|
||||
FORWARD acc_t *icmp_err_pack ARGS(( acc_t *pack, icmp_hdr_t **icmp_hdr_pp ));
|
||||
static void icmp_write ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
static void icmp_buffree ARGS(( int priority ));
|
||||
static acc_t *icmp_err_pack ARGS(( acc_t *pack, icmp_hdr_t **icmp_hdr_pp ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void icmp_bufcheck ARGS(( void ));
|
||||
static void icmp_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
|
||||
PUBLIC void icmp_prep()
|
||||
void icmp_prep()
|
||||
{
|
||||
icmp_port_table= alloc(ip_conf_nr * sizeof(icmp_port_table[0]));
|
||||
}
|
||||
|
||||
PUBLIC void icmp_init()
|
||||
void icmp_init()
|
||||
{
|
||||
int i;
|
||||
icmp_port_t *icmp_port;
|
||||
@@ -120,7 +120,7 @@ PUBLIC void icmp_init()
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void icmp_main(icmp_port)
|
||||
static void icmp_main(icmp_port)
|
||||
icmp_port_t *icmp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -160,7 +160,7 @@ icmp_port_t *icmp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE acc_t *icmp_getdata(port, offset, count, for_ioctl)
|
||||
static acc_t *icmp_getdata(port, offset, count, for_ioctl)
|
||||
int port;
|
||||
size_t offset, count;
|
||||
int for_ioctl;
|
||||
@@ -229,7 +229,7 @@ int for_ioctl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE int icmp_putdata(port, offset, data, for_ioctl)
|
||||
static int icmp_putdata(port, offset, data, for_ioctl)
|
||||
int port;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -270,7 +270,7 @@ int for_ioctl;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void icmp_read(icmp_port)
|
||||
static void icmp_read(icmp_port)
|
||||
icmp_port_t *icmp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -289,7 +289,7 @@ icmp_port_t *icmp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void icmp_snd_time_exceeded(port_nr, pack, code)
|
||||
void icmp_snd_time_exceeded(port_nr, pack, code)
|
||||
int port_nr;
|
||||
acc_t *pack;
|
||||
int code;
|
||||
@@ -315,7 +315,7 @@ int code;
|
||||
enqueue_pack(icmp_port, pack);
|
||||
}
|
||||
|
||||
PUBLIC void icmp_snd_redirect(port_nr, pack, code, gw)
|
||||
void icmp_snd_redirect(port_nr, pack, code, gw)
|
||||
int port_nr;
|
||||
acc_t *pack;
|
||||
int code;
|
||||
@@ -345,7 +345,7 @@ ipaddr_t gw;
|
||||
enqueue_pack(icmp_port, pack);
|
||||
}
|
||||
|
||||
PUBLIC void icmp_snd_unreachable(port_nr, pack, code)
|
||||
void icmp_snd_unreachable(port_nr, pack, code)
|
||||
int port_nr;
|
||||
acc_t *pack;
|
||||
int code;
|
||||
@@ -371,7 +371,7 @@ int code;
|
||||
enqueue_pack(icmp_port, pack);
|
||||
}
|
||||
|
||||
PUBLIC void icmp_snd_mtu(
|
||||
void icmp_snd_mtu(
|
||||
int port_nr,
|
||||
acc_t *pack,
|
||||
u16_t mtu
|
||||
@@ -402,7 +402,7 @@ PUBLIC void icmp_snd_mtu(
|
||||
enqueue_pack(icmp_port, pack);
|
||||
}
|
||||
|
||||
PRIVATE void process_data(icmp_port, data)
|
||||
static void process_data(icmp_port, data)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *data;
|
||||
{
|
||||
@@ -499,7 +499,7 @@ acc_t *data;
|
||||
bf_afree(icmp_data);
|
||||
}
|
||||
|
||||
PRIVATE void icmp_echo_request(icmp_port, ip_data, ip_len, ip_hdr,
|
||||
static void icmp_echo_request(icmp_port, ip_data, ip_len, ip_hdr,
|
||||
icmp_data, icmp_len, icmp_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *ip_data, *icmp_data;
|
||||
@@ -586,7 +586,7 @@ icmp_hdr_t *icmp_hdr;
|
||||
enqueue_pack(icmp_port, repl_ip_hdr);
|
||||
}
|
||||
|
||||
PRIVATE u16_t icmp_pack_oneCsum(icmp_pack)
|
||||
static u16_t icmp_pack_oneCsum(icmp_pack)
|
||||
acc_t *icmp_pack;
|
||||
{
|
||||
u16_t prev;
|
||||
@@ -628,7 +628,7 @@ acc_t *icmp_pack;
|
||||
return prev;
|
||||
}
|
||||
|
||||
PRIVATE acc_t *make_repl_ip(ip_hdr, ip_len)
|
||||
static acc_t *make_repl_ip(ip_hdr, ip_len)
|
||||
ip_hdr_t *ip_hdr;
|
||||
int ip_len;
|
||||
{
|
||||
@@ -658,7 +658,7 @@ int ip_len;
|
||||
return repl;
|
||||
}
|
||||
|
||||
PRIVATE void enqueue_pack(icmp_port, reply_ip_hdr)
|
||||
static void enqueue_pack(icmp_port, reply_ip_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *reply_ip_hdr;
|
||||
{
|
||||
@@ -702,7 +702,7 @@ acc_t *reply_ip_hdr;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int icmp_rate_limit(icmp_port, reply_ip_hdr)
|
||||
static int icmp_rate_limit(icmp_port, reply_ip_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *reply_ip_hdr;
|
||||
{
|
||||
@@ -773,7 +773,7 @@ acc_t *reply_ip_hdr;
|
||||
return -1;
|
||||
}
|
||||
|
||||
PRIVATE void icmp_write(ev, ev_arg)
|
||||
static void icmp_write(ev, ev_arg)
|
||||
event_t *ev;
|
||||
ev_arg_t ev_arg;
|
||||
{
|
||||
@@ -816,7 +816,7 @@ ev_arg_t ev_arg;
|
||||
icmp_port->icp_flags &= ~ICPF_WRITE_IP;
|
||||
}
|
||||
|
||||
PRIVATE void icmp_buffree(priority)
|
||||
static void icmp_buffree(priority)
|
||||
int priority;
|
||||
{
|
||||
acc_t *tmp_acc;
|
||||
@@ -840,7 +840,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void icmp_bufcheck()
|
||||
static void icmp_bufcheck()
|
||||
{
|
||||
int i;
|
||||
icmp_port_t *icmp_port;
|
||||
@@ -858,7 +858,7 @@ PRIVATE void icmp_bufcheck()
|
||||
}
|
||||
#endif
|
||||
|
||||
PRIVATE void icmp_dst_unreach(icmp_port, ip_pack, ip_hdr_len, ip_hdr, icmp_pack,
|
||||
static void icmp_dst_unreach(icmp_port, ip_pack, ip_hdr_len, ip_hdr, icmp_pack,
|
||||
icmp_len, icmp_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *ip_pack;
|
||||
@@ -941,7 +941,7 @@ icmp_hdr_t *icmp_hdr;
|
||||
bf_afree(old_ip_pack);
|
||||
}
|
||||
|
||||
PRIVATE void icmp_time_exceeded(icmp_port, ip_pack, ip_hdr_len, ip_hdr,
|
||||
static void icmp_time_exceeded(icmp_port, ip_pack, ip_hdr_len, ip_hdr,
|
||||
icmp_pack, icmp_len, icmp_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *ip_pack;
|
||||
@@ -990,7 +990,7 @@ icmp_hdr_t *icmp_hdr;
|
||||
bf_afree(old_ip_pack);
|
||||
}
|
||||
|
||||
PRIVATE void icmp_router_advertisement(icmp_port, icmp_pack, icmp_len, icmp_hdr)
|
||||
static void icmp_router_advertisement(icmp_port, icmp_pack, icmp_len, icmp_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *icmp_pack;
|
||||
int icmp_len;
|
||||
@@ -1063,7 +1063,7 @@ icmp_hdr_t *icmp_hdr;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void icmp_redirect(icmp_port, ip_hdr, icmp_pack, icmp_len, icmp_hdr)
|
||||
static void icmp_redirect(icmp_port, ip_hdr, icmp_pack, icmp_len, icmp_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
ip_hdr_t *ip_hdr;
|
||||
acc_t *icmp_pack;
|
||||
@@ -1108,7 +1108,7 @@ icmp_hdr_t *icmp_hdr;
|
||||
bf_afree(old_ip_pack);
|
||||
}
|
||||
|
||||
PRIVATE acc_t *icmp_err_pack(pack, icmp_hdr_pp)
|
||||
static acc_t *icmp_err_pack(pack, icmp_hdr_pp)
|
||||
acc_t *pack;
|
||||
icmp_hdr_t **icmp_hdr_pp;
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ Copyright 1995 Philip Homburg
|
||||
#include "inet.h"
|
||||
#include "io.h"
|
||||
|
||||
PUBLIC void writeIpAddr(addr)
|
||||
void writeIpAddr(addr)
|
||||
ipaddr_t addr;
|
||||
{
|
||||
#define addrInBytes ((u8_t *)&addr)
|
||||
@@ -19,7 +19,7 @@ ipaddr_t addr;
|
||||
#undef addrInBytes
|
||||
}
|
||||
|
||||
PUBLIC void writeEtherAddr(addr)
|
||||
void writeEtherAddr(addr)
|
||||
ether_addr_t *addr;
|
||||
{
|
||||
#define addrInBytes ((u8_t *)addr->ea_addr)
|
||||
|
||||
@@ -23,27 +23,27 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void ip_close ARGS(( int fd ));
|
||||
FORWARD int ip_cancel ARGS(( int fd, int which_operation ));
|
||||
FORWARD int ip_select ARGS(( int fd, unsigned operations ));
|
||||
static void ip_close ARGS(( int fd ));
|
||||
static int ip_cancel ARGS(( int fd, int which_operation ));
|
||||
static int ip_select ARGS(( int fd, unsigned operations ));
|
||||
|
||||
FORWARD void ip_buffree ARGS(( int priority ));
|
||||
static void ip_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void ip_bufcheck ARGS(( void ));
|
||||
static void ip_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
FORWARD void ip_bad_callback ARGS(( struct ip_port *ip_port ));
|
||||
static void ip_bad_callback ARGS(( struct ip_port *ip_port ));
|
||||
|
||||
PUBLIC ip_port_t *ip_port_table;
|
||||
PUBLIC ip_fd_t ip_fd_table[IP_FD_NR];
|
||||
PUBLIC ip_ass_t ip_ass_table[IP_ASS_NR];
|
||||
ip_port_t *ip_port_table;
|
||||
ip_fd_t ip_fd_table[IP_FD_NR];
|
||||
ip_ass_t ip_ass_table[IP_ASS_NR];
|
||||
|
||||
PUBLIC void ip_prep()
|
||||
void ip_prep()
|
||||
{
|
||||
ip_port_table= alloc(ip_conf_nr * sizeof(ip_port_table[0]));
|
||||
icmp_prep();
|
||||
}
|
||||
|
||||
PUBLIC void ip_init()
|
||||
void ip_init()
|
||||
{
|
||||
int i, j, result;
|
||||
ip_ass_t *ip_ass;
|
||||
@@ -137,7 +137,7 @@ PUBLIC void ip_init()
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int ip_cancel (fd, which_operation)
|
||||
static int ip_cancel (fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -180,7 +180,7 @@ int which_operation;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int ip_select(fd, operations)
|
||||
static int ip_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -211,7 +211,7 @@ unsigned operations;
|
||||
return resops;
|
||||
}
|
||||
|
||||
PUBLIC int ip_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
int ip_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port;
|
||||
int srfd;
|
||||
@@ -258,7 +258,7 @@ select_res_t select_res;
|
||||
return i;
|
||||
}
|
||||
|
||||
PRIVATE void ip_close (fd)
|
||||
static void ip_close (fd)
|
||||
int fd;
|
||||
{
|
||||
ip_fd_t *ip_fd;
|
||||
@@ -280,7 +280,7 @@ int fd;
|
||||
ip_fd->if_flags= IFF_EMPTY;
|
||||
}
|
||||
|
||||
PRIVATE void ip_buffree(priority)
|
||||
static void ip_buffree(priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -423,7 +423,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void ip_bufcheck()
|
||||
static void ip_bufcheck()
|
||||
{
|
||||
int i;
|
||||
ip_port_t *ip_port;
|
||||
@@ -482,7 +482,7 @@ PRIVATE void ip_bufcheck()
|
||||
}
|
||||
#endif /* BUF_CONSISTENCY_CHECK */
|
||||
|
||||
PRIVATE void ip_bad_callback(ip_port)
|
||||
static void ip_bad_callback(ip_port)
|
||||
struct ip_port *ip_port;
|
||||
{
|
||||
ip_panic(( "no callback filled in for port %d", ip_port->ip_port ));
|
||||
|
||||
@@ -29,34 +29,34 @@ typedef struct xmit_hdr
|
||||
ipaddr_t xh_ipaddr;
|
||||
} xmit_hdr_t;
|
||||
|
||||
PRIVATE ether_addr_t broadcast_ethaddr=
|
||||
static ether_addr_t broadcast_ethaddr=
|
||||
{
|
||||
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
|
||||
};
|
||||
PRIVATE ether_addr_t ipmulticast_ethaddr=
|
||||
static ether_addr_t ipmulticast_ethaddr=
|
||||
{
|
||||
{ 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 }
|
||||
};
|
||||
|
||||
FORWARD void do_eth_read ARGS(( ip_port_t *port ));
|
||||
FORWARD acc_t *get_eth_data ARGS(( int fd, size_t offset,
|
||||
static void do_eth_read ARGS(( ip_port_t *port ));
|
||||
static acc_t *get_eth_data ARGS(( int fd, size_t offset,
|
||||
size_t count, int for_ioctl ));
|
||||
FORWARD int put_eth_data ARGS(( int fd, size_t offset,
|
||||
static int put_eth_data ARGS(( int fd, size_t offset,
|
||||
acc_t *data, int for_ioctl ));
|
||||
FORWARD void ipeth_main ARGS(( ip_port_t *port ));
|
||||
FORWARD void ipeth_set_ipaddr ARGS(( ip_port_t *port ));
|
||||
FORWARD void ipeth_restart_send ARGS(( ip_port_t *ip_port ));
|
||||
FORWARD int ipeth_send ARGS(( struct ip_port *ip_port, ipaddr_t dest,
|
||||
static void ipeth_main ARGS(( ip_port_t *port ));
|
||||
static void ipeth_set_ipaddr ARGS(( ip_port_t *port ));
|
||||
static void ipeth_restart_send ARGS(( ip_port_t *ip_port ));
|
||||
static int ipeth_send ARGS(( struct ip_port *ip_port, ipaddr_t dest,
|
||||
acc_t *pack, int type ));
|
||||
FORWARD void ipeth_arp_reply ARGS(( int ip_port_nr, ipaddr_t ipaddr,
|
||||
static void ipeth_arp_reply ARGS(( int ip_port_nr, ipaddr_t ipaddr,
|
||||
ether_addr_t *dst_ether_ptr ));
|
||||
FORWARD int ipeth_update_ttl ARGS(( time_t enq_time, time_t now,
|
||||
static int ipeth_update_ttl ARGS(( time_t enq_time, time_t now,
|
||||
acc_t *eth_pack ));
|
||||
FORWARD void ip_eth_arrived ARGS(( int port, acc_t *pack,
|
||||
static void ip_eth_arrived ARGS(( int port, acc_t *pack,
|
||||
size_t pack_size ));
|
||||
|
||||
|
||||
PUBLIC int ipeth_init(ip_port)
|
||||
int ipeth_init(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
assert(BUF_S >= sizeof(xmit_hdr_t));
|
||||
@@ -85,7 +85,7 @@ ip_port_t *ip_port;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void ipeth_main(ip_port)
|
||||
static void ipeth_main(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
int result;
|
||||
@@ -137,7 +137,7 @@ ip_port_t *ip_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE acc_t *get_eth_data (fd, offset, count, for_ioctl)
|
||||
static acc_t *get_eth_data (fd, offset, count, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
size_t count;
|
||||
@@ -206,7 +206,7 @@ int for_ioctl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int put_eth_data (port, offset, data, for_ioctl)
|
||||
static int put_eth_data (port, offset, data, for_ioctl)
|
||||
int port;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -254,7 +254,7 @@ int for_ioctl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
PRIVATE void ipeth_set_ipaddr(ip_port)
|
||||
static void ipeth_set_ipaddr(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
arp_set_ipaddr (ip_port->ip_dl.dl_eth.de_port, ip_port->ip_ipaddr);
|
||||
@@ -262,7 +262,7 @@ ip_port_t *ip_port;
|
||||
ipeth_main(ip_port);
|
||||
}
|
||||
|
||||
PRIVATE int ipeth_send(ip_port, dest, pack, type)
|
||||
static int ipeth_send(ip_port, dest, pack, type)
|
||||
struct ip_port *ip_port;
|
||||
ipaddr_t dest;
|
||||
acc_t *pack;
|
||||
@@ -403,7 +403,7 @@ int type;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void ipeth_restart_send(ip_port)
|
||||
static void ipeth_restart_send(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
time_t now, enq_time;
|
||||
@@ -514,7 +514,7 @@ ip_port_t *ip_port;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void ipeth_arp_reply(ip_port_nr, ipaddr, eth_addr)
|
||||
static void ipeth_arp_reply(ip_port_nr, ipaddr, eth_addr)
|
||||
int ip_port_nr;
|
||||
ipaddr_t ipaddr;
|
||||
ether_addr_t *eth_addr;
|
||||
@@ -630,7 +630,7 @@ ether_addr_t *eth_addr;
|
||||
ipeth_restart_send(ip_port);
|
||||
}
|
||||
|
||||
PRIVATE int ipeth_update_ttl(enq_time, now, eth_pack)
|
||||
static int ipeth_update_ttl(enq_time, now, eth_pack)
|
||||
time_t enq_time;
|
||||
time_t now;
|
||||
acc_t *eth_pack;
|
||||
@@ -670,7 +670,7 @@ acc_t *eth_pack;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void do_eth_read(ip_port)
|
||||
static void do_eth_read(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
int result;
|
||||
@@ -698,7 +698,7 @@ ip_port_t *ip_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void ip_eth_arrived(port, pack, pack_size)
|
||||
static void ip_eth_arrived(port, pack, pack_size)
|
||||
int port;
|
||||
acc_t *pack;
|
||||
size_t pack_size;
|
||||
|
||||
@@ -19,12 +19,12 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD int ip_checkopt ARGS(( ip_fd_t *ip_fd ));
|
||||
FORWARD void reply_thr_get ARGS(( ip_fd_t *ip_fd, size_t
|
||||
static int ip_checkopt ARGS(( ip_fd_t *ip_fd ));
|
||||
static void reply_thr_get ARGS(( ip_fd_t *ip_fd, size_t
|
||||
reply, int for_ioctl ));
|
||||
FORWARD void report_addr ARGS(( ip_port_t *ip_port ));
|
||||
static void report_addr ARGS(( ip_port_t *ip_port ));
|
||||
|
||||
PUBLIC int ip_ioctl (fd, req)
|
||||
int ip_ioctl (fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -450,7 +450,7 @@ ioreq_t req;
|
||||
(acc_t *)0, TRUE);
|
||||
}
|
||||
|
||||
PUBLIC void ip_hash_proto(ip_fd)
|
||||
void ip_hash_proto(ip_fd)
|
||||
ip_fd_t *ip_fd;
|
||||
{
|
||||
ip_port_t *ip_port;
|
||||
@@ -470,7 +470,7 @@ ip_fd_t *ip_fd;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void ip_unhash_proto(ip_fd)
|
||||
void ip_unhash_proto(ip_fd)
|
||||
ip_fd_t *ip_fd;
|
||||
{
|
||||
ip_port_t *ip_port;
|
||||
@@ -500,7 +500,7 @@ ip_fd_t *ip_fd;
|
||||
*ip_fd_p= curr->if_proto_next;
|
||||
}
|
||||
|
||||
PUBLIC int ip_setconf(ip_port_nr, ipconf)
|
||||
int ip_setconf(ip_port_nr, ipconf)
|
||||
int ip_port_nr;
|
||||
nwio_ipconf_t *ipconf;
|
||||
{
|
||||
@@ -576,7 +576,7 @@ nwio_ipconf_t *ipconf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int ip_checkopt (ip_fd)
|
||||
static int ip_checkopt (ip_fd)
|
||||
ip_fd_t *ip_fd;
|
||||
{
|
||||
/* bug: we don't check access modes yet */
|
||||
@@ -621,7 +621,7 @@ ip_fd_t *ip_fd;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void reply_thr_get(ip_fd, reply, for_ioctl)
|
||||
static void reply_thr_get(ip_fd, reply, for_ioctl)
|
||||
ip_fd_t *ip_fd;
|
||||
size_t reply;
|
||||
int for_ioctl;
|
||||
@@ -632,7 +632,7 @@ int for_ioctl;
|
||||
assert (!result);
|
||||
}
|
||||
|
||||
PRIVATE void report_addr(ip_port)
|
||||
static void report_addr(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
int i, hdr_len;
|
||||
|
||||
@@ -15,12 +15,12 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
PUBLIC ipaddr_t ip_get_netmask (ipaddr_t hostaddr)
|
||||
ipaddr_t ip_get_netmask (ipaddr_t hostaddr)
|
||||
{
|
||||
return ip_netmask(ip_nettype(hostaddr));
|
||||
}
|
||||
|
||||
PUBLIC int ip_chk_hdropt (u8_t *opt, int optlen)
|
||||
int ip_chk_hdropt (u8_t *opt, int optlen)
|
||||
{
|
||||
int i, security_present= FALSE, lose_source_present= FALSE,
|
||||
strict_source_present= FALSE, record_route_present= FALSE,
|
||||
@@ -119,7 +119,7 @@ PUBLIC int ip_chk_hdropt (u8_t *opt, int optlen)
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC void ip_print_frags(acc_t *acc)
|
||||
void ip_print_frags(acc_t *acc)
|
||||
{
|
||||
#if DEBUG
|
||||
ip_hdr_t *ip_hdr;
|
||||
@@ -147,14 +147,14 @@ assert (acc->acc_length >= IP_MIN_HDR_SIZE);
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC ipaddr_t ip_get_ifaddr(int port_nr)
|
||||
ipaddr_t ip_get_ifaddr(int port_nr)
|
||||
{
|
||||
assert(port_nr >= 0 && port_nr < ip_conf_nr);
|
||||
|
||||
return ip_port_table[port_nr].ip_ipaddr;
|
||||
}
|
||||
|
||||
PUBLIC nettype_t ip_nettype(ipaddr_t ipaddr)
|
||||
nettype_t ip_nettype(ipaddr_t ipaddr)
|
||||
{
|
||||
u8_t highbyte;
|
||||
nettype_t nettype;
|
||||
@@ -192,7 +192,7 @@ PUBLIC nettype_t ip_nettype(ipaddr_t ipaddr)
|
||||
return nettype;
|
||||
}
|
||||
|
||||
PUBLIC ipaddr_t ip_netmask(nettype_t nettype)
|
||||
ipaddr_t ip_netmask(nettype_t nettype)
|
||||
{
|
||||
switch(nettype)
|
||||
{
|
||||
@@ -206,7 +206,7 @@ PUBLIC ipaddr_t ip_netmask(nettype_t nettype)
|
||||
}
|
||||
|
||||
#if 0
|
||||
PUBLIC char *ip_nettoa(nettype_t nettype)
|
||||
char *ip_nettoa(nettype_t nettype)
|
||||
{
|
||||
switch(nettype)
|
||||
{
|
||||
|
||||
@@ -19,12 +19,12 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void ipps_main ARGS(( ip_port_t *ip_port ));
|
||||
FORWARD void ipps_set_ipaddr ARGS(( ip_port_t *ip_port ));
|
||||
FORWARD int ipps_send ARGS(( struct ip_port *ip_port, ipaddr_t dest,
|
||||
static void ipps_main ARGS(( ip_port_t *ip_port ));
|
||||
static void ipps_set_ipaddr ARGS(( ip_port_t *ip_port ));
|
||||
static int ipps_send ARGS(( struct ip_port *ip_port, ipaddr_t dest,
|
||||
acc_t *pack, int type ));
|
||||
|
||||
PUBLIC int ipps_init(ip_port)
|
||||
int ipps_init(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
int result;
|
||||
@@ -40,7 +40,7 @@ ip_port_t *ip_port;
|
||||
return result;
|
||||
}
|
||||
|
||||
PUBLIC void ipps_get(ip_port_nr)
|
||||
void ipps_get(ip_port_nr)
|
||||
int ip_port_nr;
|
||||
{
|
||||
int result;
|
||||
@@ -112,7 +112,7 @@ int ip_port_nr;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void ipps_put(ip_port_nr, nexthop, pack)
|
||||
void ipps_put(ip_port_nr, nexthop, pack)
|
||||
int ip_port_nr;
|
||||
ipaddr_t nexthop;
|
||||
acc_t *pack;
|
||||
@@ -128,18 +128,18 @@ acc_t *pack;
|
||||
ip_arrived(ip_port, pack);
|
||||
}
|
||||
|
||||
PRIVATE void ipps_main(ip_port)
|
||||
static void ipps_main(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
PRIVATE void ipps_set_ipaddr(ip_port)
|
||||
static void ipps_set_ipaddr(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
}
|
||||
|
||||
PRIVATE int ipps_send(ip_port, dest, pack, type)
|
||||
static int ipps_send(ip_port, dest, pack, type)
|
||||
struct ip_port *ip_port;
|
||||
ipaddr_t dest;
|
||||
acc_t *pack;
|
||||
|
||||
@@ -20,16 +20,16 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id,
|
||||
static ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id,
|
||||
ipproto_t proto, ipaddr_t src, ipaddr_t dst ));
|
||||
FORWARD acc_t *merge_frags ARGS(( acc_t *first, acc_t *second ));
|
||||
FORWARD int ip_frag_chk ARGS(( acc_t *pack ));
|
||||
FORWARD acc_t *reassemble ARGS(( ip_port_t *ip_port, acc_t *pack,
|
||||
static acc_t *merge_frags ARGS(( acc_t *first, acc_t *second ));
|
||||
static int ip_frag_chk ARGS(( acc_t *pack ));
|
||||
static acc_t *reassemble ARGS(( ip_port_t *ip_port, acc_t *pack,
|
||||
ip_hdr_t *ip_hdr ));
|
||||
FORWARD void route_packets ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
FORWARD int broadcast_dst ARGS(( ip_port_t *ip_port, ipaddr_t dest ));
|
||||
static void route_packets ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
static int broadcast_dst ARGS(( ip_port_t *ip_port, ipaddr_t dest ));
|
||||
|
||||
PUBLIC int ip_read(int fd, size_t count)
|
||||
int ip_read(int fd, size_t count)
|
||||
{
|
||||
ip_fd_t *ip_fd;
|
||||
acc_t *pack;
|
||||
@@ -65,7 +65,7 @@ PUBLIC int ip_read(int fd, size_t count)
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PRIVATE acc_t *reassemble (ip_port, pack, pack_hdr)
|
||||
static acc_t *reassemble (ip_port, pack, pack_hdr)
|
||||
ip_port_t *ip_port;
|
||||
acc_t *pack;
|
||||
ip_hdr_t *pack_hdr;
|
||||
@@ -167,7 +167,7 @@ ip_hdr_t *pack_hdr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE acc_t *merge_frags (first, second)
|
||||
static acc_t *merge_frags (first, second)
|
||||
acc_t *first, *second;
|
||||
{
|
||||
ip_hdr_t *first_hdr, *second_hdr;
|
||||
@@ -237,7 +237,7 @@ assert (first_hdr_size + first_datasize == bf_bufsize(first));
|
||||
return first;
|
||||
}
|
||||
|
||||
PRIVATE ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id,
|
||||
static ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id,
|
||||
ipproto_t proto, ipaddr_t src, ipaddr_t dst ))
|
||||
{
|
||||
ip_ass_t *new_ass_ent, *tmp_ass_ent;
|
||||
@@ -311,7 +311,7 @@ PRIVATE ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id,
|
||||
return new_ass_ent;
|
||||
}
|
||||
|
||||
PRIVATE int ip_frag_chk(pack)
|
||||
static int ip_frag_chk(pack)
|
||||
acc_t *pack;
|
||||
{
|
||||
ip_hdr_t *ip_hdr;
|
||||
@@ -362,7 +362,7 @@ acc_t *pack;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PUBLIC int ip_sel_read (ip_fd_t *ip_fd)
|
||||
int ip_sel_read (ip_fd_t *ip_fd)
|
||||
{
|
||||
acc_t *pack;
|
||||
|
||||
@@ -384,7 +384,7 @@ PUBLIC int ip_sel_read (ip_fd_t *ip_fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PUBLIC void ip_packet2user (ip_fd, pack, exp_time, data_len)
|
||||
void ip_packet2user (ip_fd, pack, exp_time, data_len)
|
||||
ip_fd_t *ip_fd;
|
||||
acc_t *pack;
|
||||
time_t exp_time;
|
||||
@@ -471,7 +471,7 @@ size_t data_len;
|
||||
assert (result >= 0);
|
||||
}
|
||||
|
||||
PUBLIC void ip_port_arrive (ip_port, pack, ip_hdr)
|
||||
void ip_port_arrive (ip_port, pack, ip_hdr)
|
||||
ip_port_t *ip_port;
|
||||
acc_t *pack;
|
||||
ip_hdr_t *ip_hdr;
|
||||
@@ -589,7 +589,7 @@ ip_hdr_t *ip_hdr;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void ip_arrived(ip_port, pack)
|
||||
void ip_arrived(ip_port, pack)
|
||||
ip_port_t *ip_port;
|
||||
acc_t *pack;
|
||||
{
|
||||
@@ -718,7 +718,7 @@ assert (pack->acc_length >= IP_MIN_HDR_SIZE);
|
||||
ev_enqueue(&ip_port->ip_routeq_event, route_packets, ev_arg);
|
||||
}
|
||||
|
||||
PUBLIC void ip_arrived_broadcast(ip_port, pack)
|
||||
void ip_arrived_broadcast(ip_port, pack)
|
||||
ip_port_t *ip_port;
|
||||
acc_t *pack;
|
||||
{
|
||||
@@ -784,7 +784,7 @@ assert (pack->acc_length >= IP_MIN_HDR_SIZE);
|
||||
ip_port_arrive (ip_port, pack, ip_hdr);
|
||||
}
|
||||
|
||||
PRIVATE void route_packets(ev, ev_arg)
|
||||
static void route_packets(ev, ev_arg)
|
||||
event_t *ev;
|
||||
ev_arg_t ev_arg;
|
||||
{
|
||||
@@ -992,7 +992,7 @@ ev_arg_t ev_arg;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int broadcast_dst(ip_port, dest)
|
||||
static int broadcast_dst(ip_port, dest)
|
||||
ip_port_t *ip_port;
|
||||
ipaddr_t dest;
|
||||
{
|
||||
|
||||
@@ -21,9 +21,9 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void error_reply ARGS(( ip_fd_t *fd, int error ));
|
||||
static void error_reply ARGS(( ip_fd_t *fd, int error ));
|
||||
|
||||
PUBLIC int ip_write (fd, count)
|
||||
int ip_write (fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -51,7 +51,7 @@ size_t count;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int ip_send(fd, data, data_len)
|
||||
int ip_send(fd, data, data_len)
|
||||
int fd;
|
||||
acc_t *data;
|
||||
size_t data_len;
|
||||
@@ -336,7 +336,7 @@ size_t data_len;
|
||||
return r;
|
||||
}
|
||||
|
||||
PUBLIC void ip_hdr_chksum(ip_hdr, ip_hdr_len)
|
||||
void ip_hdr_chksum(ip_hdr, ip_hdr_len)
|
||||
ip_hdr_t *ip_hdr;
|
||||
int ip_hdr_len;
|
||||
{
|
||||
@@ -344,7 +344,7 @@ int ip_hdr_len;
|
||||
ip_hdr->ih_hdr_chk= ~oneC_sum (0, (u16_t *)ip_hdr, ip_hdr_len);
|
||||
}
|
||||
|
||||
PUBLIC acc_t *ip_split_pack (ip_port, ref_last, mtu)
|
||||
acc_t *ip_split_pack (ip_port, ref_last, mtu)
|
||||
ip_port_t *ip_port;
|
||||
acc_t **ref_last;
|
||||
int mtu;
|
||||
@@ -497,7 +497,7 @@ int mtu;
|
||||
return first_pack;
|
||||
}
|
||||
|
||||
PRIVATE void error_reply (ip_fd, error)
|
||||
static void error_reply (ip_fd, error)
|
||||
ip_fd_t *ip_fd;
|
||||
int error;
|
||||
{
|
||||
|
||||
@@ -35,10 +35,10 @@ typedef struct oroute_hash
|
||||
oroute_t *orh_route;
|
||||
} oroute_hash_t;
|
||||
|
||||
PRIVATE oroute_t oroute_table[OROUTE_NR];
|
||||
PRIVATE oroute_t *oroute_head;
|
||||
PRIVATE int static_oroute_nr;
|
||||
PRIVATE oroute_hash_t oroute_hash_table[OROUTE_HASH_NR][OROUTE_HASH_ASS_NR];
|
||||
static oroute_t oroute_table[OROUTE_NR];
|
||||
static oroute_t *oroute_head;
|
||||
static int static_oroute_nr;
|
||||
static oroute_hash_t oroute_hash_table[OROUTE_HASH_NR][OROUTE_HASH_ASS_NR];
|
||||
|
||||
#define IROUTE_NR 512
|
||||
#define IROUTE_HASH_ASS_NR 4
|
||||
@@ -57,17 +57,17 @@ typedef struct iroute_hash
|
||||
iroute_t *irh_route;
|
||||
} iroute_hash_t;
|
||||
|
||||
PRIVATE iroute_t iroute_table[IROUTE_NR];
|
||||
PRIVATE iroute_hash_t iroute_hash_table[IROUTE_HASH_NR][IROUTE_HASH_ASS_NR];
|
||||
static iroute_t iroute_table[IROUTE_NR];
|
||||
static iroute_hash_t iroute_hash_table[IROUTE_HASH_NR][IROUTE_HASH_ASS_NR];
|
||||
|
||||
FORWARD oroute_t *oroute_find_ent ARGS(( int port_nr, ipaddr_t dest ));
|
||||
FORWARD void oroute_del ARGS(( oroute_t *oroute ));
|
||||
FORWARD oroute_t *sort_dists ARGS(( oroute_t *oroute ));
|
||||
FORWARD oroute_t *sort_gws ARGS(( oroute_t *oroute ));
|
||||
FORWARD void oroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask ));
|
||||
FORWARD void iroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask ));
|
||||
static oroute_t *oroute_find_ent ARGS(( int port_nr, ipaddr_t dest ));
|
||||
static void oroute_del ARGS(( oroute_t *oroute ));
|
||||
static oroute_t *sort_dists ARGS(( oroute_t *oroute ));
|
||||
static oroute_t *sort_gws ARGS(( oroute_t *oroute ));
|
||||
static void oroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask ));
|
||||
static void iroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask ));
|
||||
|
||||
PUBLIC void ipr_init()
|
||||
void ipr_init()
|
||||
{
|
||||
int i;
|
||||
oroute_t *oroute;
|
||||
@@ -84,7 +84,7 @@ PUBLIC void ipr_init()
|
||||
}
|
||||
|
||||
|
||||
PUBLIC iroute_t *iroute_frag(port_nr, dest)
|
||||
iroute_t *iroute_frag(port_nr, dest)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
{
|
||||
@@ -184,7 +184,7 @@ ipaddr_t dest;
|
||||
return bestroute;
|
||||
}
|
||||
|
||||
PUBLIC int oroute_frag(port_nr, dest, ttl, msgsize, nexthop)
|
||||
int oroute_frag(port_nr, dest, ttl, msgsize, nexthop)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
int ttl;
|
||||
@@ -207,7 +207,7 @@ ipaddr_t *nexthop;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int ipr_add_oroute(port_nr, dest, subnetmask, gateway,
|
||||
int ipr_add_oroute(port_nr, dest, subnetmask, gateway,
|
||||
timeout, dist, mtu, static_route, preference, oroute_p)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
@@ -408,7 +408,7 @@ oroute_t **oroute_p;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int ipr_del_oroute(port_nr, dest, subnetmask, gateway, static_route)
|
||||
int ipr_del_oroute(port_nr, dest, subnetmask, gateway, static_route)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
ipaddr_t subnetmask;
|
||||
@@ -447,7 +447,7 @@ int static_route;
|
||||
|
||||
|
||||
|
||||
PUBLIC void ipr_chk_otab(port_nr, addr, mask)
|
||||
void ipr_chk_otab(port_nr, addr, mask)
|
||||
int port_nr;
|
||||
ipaddr_t addr;
|
||||
ipaddr_t mask;
|
||||
@@ -495,7 +495,7 @@ ipaddr_t mask;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void ipr_gateway_down(port_nr, gateway, timeout)
|
||||
void ipr_gateway_down(port_nr, gateway, timeout)
|
||||
int port_nr;
|
||||
ipaddr_t gateway;
|
||||
time_t timeout;
|
||||
@@ -523,7 +523,7 @@ time_t timeout;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void ipr_destunrch(port_nr, dest, netmask, timeout)
|
||||
void ipr_destunrch(port_nr, dest, netmask, timeout)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
ipaddr_t netmask;
|
||||
@@ -548,7 +548,7 @@ time_t timeout;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void ipr_redirect(port_nr, dest, netmask, old_gateway, new_gateway,
|
||||
void ipr_redirect(port_nr, dest, netmask, old_gateway, new_gateway,
|
||||
timeout)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
@@ -611,7 +611,7 @@ time_t timeout;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void ipr_ttl_exc(port_nr, dest, netmask, timeout)
|
||||
void ipr_ttl_exc(port_nr, dest, netmask, timeout)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
ipaddr_t netmask;
|
||||
@@ -651,7 +651,7 @@ time_t timeout;
|
||||
assert(result == NW_OK);
|
||||
}
|
||||
|
||||
PUBLIC void ipr_mtu(
|
||||
void ipr_mtu(
|
||||
int port_nr,
|
||||
ipaddr_t dest,
|
||||
u16_t mtu,
|
||||
@@ -683,7 +683,7 @@ PUBLIC void ipr_mtu(
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int ipr_get_oroute(ent_no, route_ent)
|
||||
int ipr_get_oroute(ent_no, route_ent)
|
||||
int ent_no;
|
||||
nwio_route_t *route_ent;
|
||||
{
|
||||
@@ -720,7 +720,7 @@ nwio_route_t *route_ent;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE oroute_t *oroute_find_ent(port_nr, dest)
|
||||
static oroute_t *oroute_find_ent(port_nr, dest)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
{
|
||||
@@ -812,7 +812,7 @@ ipaddr_t dest;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void oroute_del(oroute)
|
||||
static void oroute_del(oroute)
|
||||
oroute_t *oroute;
|
||||
{
|
||||
oroute_t *prev, *nw_route, *gw_route, *dist_route, *prev_route;
|
||||
@@ -888,7 +888,7 @@ oroute_t *oroute;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE oroute_t *sort_dists(oroute)
|
||||
static oroute_t *sort_dists(oroute)
|
||||
oroute_t *oroute;
|
||||
{
|
||||
oroute_t *r, *prev, *best, *best_prev;
|
||||
@@ -932,7 +932,7 @@ oroute_t *oroute;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE oroute_t *sort_gws(oroute)
|
||||
static oroute_t *sort_gws(oroute)
|
||||
oroute_t *oroute;
|
||||
{
|
||||
oroute_t *r, *prev, *best, *best_prev;
|
||||
@@ -976,7 +976,7 @@ oroute_t *oroute;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void oroute_uncache_nw(dest, netmask)
|
||||
static void oroute_uncache_nw(dest, netmask)
|
||||
ipaddr_t dest;
|
||||
ipaddr_t netmask;
|
||||
{
|
||||
@@ -1002,7 +1002,7 @@ ipaddr_t netmask;
|
||||
* Input routing
|
||||
*/
|
||||
|
||||
PUBLIC int ipr_get_iroute(ent_no, route_ent)
|
||||
int ipr_get_iroute(ent_no, route_ent)
|
||||
int ent_no;
|
||||
nwio_route_t *route_ent;
|
||||
{
|
||||
@@ -1035,7 +1035,7 @@ nwio_route_t *route_ent;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int ipr_add_iroute(port_nr, dest, subnetmask, gateway,
|
||||
int ipr_add_iroute(port_nr, dest, subnetmask, gateway,
|
||||
dist, mtu, static_route, iroute_p)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
@@ -1124,7 +1124,7 @@ iroute_t **iroute_p;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int ipr_del_iroute(port_nr, dest, subnetmask, gateway, static_route)
|
||||
int ipr_del_iroute(port_nr, dest, subnetmask, gateway, static_route)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
ipaddr_t subnetmask;
|
||||
@@ -1162,7 +1162,7 @@ int static_route;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void ipr_chk_itab(port_nr, addr, mask)
|
||||
void ipr_chk_itab(port_nr, addr, mask)
|
||||
int port_nr;
|
||||
ipaddr_t addr;
|
||||
ipaddr_t mask;
|
||||
@@ -1218,7 +1218,7 @@ ipaddr_t mask;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void iroute_uncache_nw(dest, netmask)
|
||||
static void iroute_uncache_nw(dest, netmask)
|
||||
ipaddr_t dest;
|
||||
ipaddr_t netmask;
|
||||
{
|
||||
|
||||
@@ -55,36 +55,36 @@ typedef struct psip_fd
|
||||
#define PFF_PROMISC 4
|
||||
#define PFF_NEXTHOP 8
|
||||
|
||||
PRIVATE psip_port_t *psip_port_table;
|
||||
PRIVATE psip_fd_t psip_fd_table[PSIP_FD_NR];
|
||||
static psip_port_t *psip_port_table;
|
||||
static psip_fd_t psip_fd_table[PSIP_FD_NR];
|
||||
|
||||
FORWARD int psip_open ARGS(( int port, int srfd,
|
||||
static int psip_open ARGS(( int port, int srfd,
|
||||
get_userdata_t get_userdata, put_userdata_t put_userdata,
|
||||
put_pkt_t pkt_pkt, select_res_t select_res ));
|
||||
FORWARD int psip_ioctl ARGS(( int fd, ioreq_t req ));
|
||||
FORWARD int psip_read ARGS(( int fd, size_t count ));
|
||||
FORWARD int psip_write ARGS(( int fd, size_t count ));
|
||||
FORWARD int psip_select ARGS(( int port_nr, unsigned operations ));
|
||||
FORWARD void psip_close ARGS(( int fd ));
|
||||
FORWARD int psip_cancel ARGS(( int fd, int which_operation ));
|
||||
FORWARD void promisc_restart_read ARGS(( psip_port_t *psip_port ));
|
||||
FORWARD int psip_setopt ARGS(( psip_fd_t *psip_fd, nwio_psipopt_t *newoptp ));
|
||||
FORWARD void psip_buffree ARGS(( int priority ));
|
||||
FORWARD void check_promisc ARGS(( psip_port_t *psip_port ));
|
||||
static int psip_ioctl ARGS(( int fd, ioreq_t req ));
|
||||
static int psip_read ARGS(( int fd, size_t count ));
|
||||
static int psip_write ARGS(( int fd, size_t count ));
|
||||
static int psip_select ARGS(( int port_nr, unsigned operations ));
|
||||
static void psip_close ARGS(( int fd ));
|
||||
static int psip_cancel ARGS(( int fd, int which_operation ));
|
||||
static void promisc_restart_read ARGS(( psip_port_t *psip_port ));
|
||||
static int psip_setopt ARGS(( psip_fd_t *psip_fd, nwio_psipopt_t *newoptp ));
|
||||
static void psip_buffree ARGS(( int priority ));
|
||||
static void check_promisc ARGS(( psip_port_t *psip_port ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void psip_bufcheck ARGS(( void ));
|
||||
static void psip_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
FORWARD void reply_thr_put ARGS(( psip_fd_t *psip_fd, int reply,
|
||||
static void reply_thr_put ARGS(( psip_fd_t *psip_fd, int reply,
|
||||
int for_ioctl ));
|
||||
FORWARD void reply_thr_get ARGS(( psip_fd_t *psip_fd, int reply,
|
||||
static void reply_thr_get ARGS(( psip_fd_t *psip_fd, int reply,
|
||||
int for_ioctl ));
|
||||
|
||||
PUBLIC void psip_prep()
|
||||
void psip_prep()
|
||||
{
|
||||
psip_port_table= alloc(psip_conf_nr * sizeof(psip_port_table[0]));
|
||||
}
|
||||
|
||||
PUBLIC void psip_init()
|
||||
void psip_init()
|
||||
{
|
||||
int i;
|
||||
psip_port_t *psip_port;
|
||||
@@ -111,7 +111,7 @@ PUBLIC void psip_init()
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC int psip_enable(port_nr, ip_port_nr)
|
||||
int psip_enable(port_nr, ip_port_nr)
|
||||
int port_nr;
|
||||
int ip_port_nr;
|
||||
{
|
||||
@@ -135,7 +135,7 @@ int ip_port_nr;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int psip_send(port_nr, dest, pack)
|
||||
int psip_send(port_nr, dest, pack)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
acc_t *pack;
|
||||
@@ -248,7 +248,7 @@ acc_t *pack;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PRIVATE int psip_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
static int psip_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port;
|
||||
int srfd;
|
||||
@@ -285,7 +285,7 @@ select_res_t select_res;
|
||||
return i;
|
||||
}
|
||||
|
||||
PRIVATE int psip_ioctl(fd, req)
|
||||
static int psip_ioctl(fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -370,7 +370,7 @@ ioreq_t req;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int psip_read(fd, count)
|
||||
static int psip_read(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -422,7 +422,7 @@ size_t count;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int psip_write(fd, count)
|
||||
static int psip_write(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -507,7 +507,7 @@ size_t count;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int psip_select(fd, operations)
|
||||
static int psip_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -515,7 +515,7 @@ unsigned operations;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void psip_close(fd)
|
||||
static void psip_close(fd)
|
||||
int fd;
|
||||
{
|
||||
psip_port_t *psip_port;
|
||||
@@ -540,7 +540,7 @@ int fd;
|
||||
|
||||
}
|
||||
|
||||
PRIVATE int psip_cancel(fd, which_operation)
|
||||
static int psip_cancel(fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -587,7 +587,7 @@ int which_operation;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void promisc_restart_read(psip_port)
|
||||
static void promisc_restart_read(psip_port)
|
||||
psip_port_t *psip_port;
|
||||
{
|
||||
psip_fd_t *psip_fd, *prev, *next;
|
||||
@@ -648,7 +648,7 @@ again:
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int psip_setopt(psip_fd, newoptp)
|
||||
static int psip_setopt(psip_fd, newoptp)
|
||||
psip_fd_t *psip_fd;
|
||||
nwio_psipopt_t *newoptp;
|
||||
{
|
||||
@@ -691,7 +691,7 @@ nwio_psipopt_t *newoptp;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void check_promisc(psip_port)
|
||||
static void check_promisc(psip_port)
|
||||
psip_port_t *psip_port;
|
||||
{
|
||||
int i;
|
||||
@@ -733,7 +733,7 @@ psip_port_t *psip_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void psip_buffree (priority)
|
||||
static void psip_buffree (priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -763,7 +763,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void psip_bufcheck()
|
||||
static void psip_bufcheck()
|
||||
{
|
||||
int i;
|
||||
psip_port_t *psip_port;
|
||||
@@ -785,7 +785,7 @@ PRIVATE void psip_bufcheck()
|
||||
reply_thr_put
|
||||
*/
|
||||
|
||||
PRIVATE void reply_thr_put(psip_fd, reply, for_ioctl)
|
||||
static void reply_thr_put(psip_fd, reply, for_ioctl)
|
||||
psip_fd_t *psip_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
@@ -801,7 +801,7 @@ int for_ioctl;
|
||||
reply_thr_get
|
||||
*/
|
||||
|
||||
PRIVATE void reply_thr_get(psip_fd, reply, for_ioctl)
|
||||
static void reply_thr_get(psip_fd, reply, for_ioctl)
|
||||
psip_fd_t *psip_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
|
||||
@@ -14,15 +14,15 @@ Generate 256-bit random numbers
|
||||
#include "inet.h"
|
||||
#include "rand256.h"
|
||||
|
||||
PRIVATE u32_t base_bits[8];
|
||||
static u32_t base_bits[8];
|
||||
|
||||
PUBLIC void init_rand256(bits)
|
||||
void init_rand256(bits)
|
||||
u8_t bits[32];
|
||||
{
|
||||
memcpy(base_bits, bits, sizeof(base_bits));
|
||||
}
|
||||
|
||||
PUBLIC void rand256(bits)
|
||||
void rand256(bits)
|
||||
u8_t bits[32];
|
||||
{
|
||||
u32_t a;
|
||||
|
||||
@@ -20,53 +20,53 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
PUBLIC tcp_port_t *tcp_port_table;
|
||||
PUBLIC tcp_fd_t tcp_fd_table[TCP_FD_NR];
|
||||
PUBLIC tcp_conn_t tcp_conn_table[TCP_CONN_NR];
|
||||
PUBLIC sr_cancel_t tcp_cancel_f;
|
||||
tcp_port_t *tcp_port_table;
|
||||
tcp_fd_t tcp_fd_table[TCP_FD_NR];
|
||||
tcp_conn_t tcp_conn_table[TCP_CONN_NR];
|
||||
sr_cancel_t tcp_cancel_f;
|
||||
|
||||
FORWARD void tcp_main ARGS(( tcp_port_t *port ));
|
||||
FORWARD int tcp_select ARGS(( int fd, unsigned operations ));
|
||||
FORWARD acc_t *tcp_get_data ARGS(( int fd, size_t offset,
|
||||
static void tcp_main ARGS(( tcp_port_t *port ));
|
||||
static int tcp_select ARGS(( int fd, unsigned operations ));
|
||||
static acc_t *tcp_get_data ARGS(( int fd, size_t offset,
|
||||
size_t count, int for_ioctl ));
|
||||
FORWARD int tcp_put_data ARGS(( int fd, size_t offset,
|
||||
static int tcp_put_data ARGS(( int fd, size_t offset,
|
||||
acc_t *data, int for_ioctl ));
|
||||
FORWARD void tcp_put_pkt ARGS(( int fd, acc_t *data, size_t datalen ));
|
||||
FORWARD void read_ip_packets ARGS(( tcp_port_t *port ));
|
||||
FORWARD int tcp_setconf ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD int tcp_setopt ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD int tcp_connect ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD int tcp_listen ARGS(( tcp_fd_t *tcp_fd, int do_listenq ));
|
||||
FORWARD int tcp_acceptto ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD tcpport_t find_unused_port ARGS(( int fd ));
|
||||
FORWARD int is_unused_port ARGS(( tcpport_t port ));
|
||||
FORWARD int reply_thr_put ARGS(( tcp_fd_t *tcp_fd, int reply,
|
||||
static void tcp_put_pkt ARGS(( int fd, acc_t *data, size_t datalen ));
|
||||
static void read_ip_packets ARGS(( tcp_port_t *port ));
|
||||
static int tcp_setconf ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static int tcp_setopt ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static int tcp_connect ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static int tcp_listen ARGS(( tcp_fd_t *tcp_fd, int do_listenq ));
|
||||
static int tcp_acceptto ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static tcpport_t find_unused_port ARGS(( int fd ));
|
||||
static int is_unused_port ARGS(( tcpport_t port ));
|
||||
static int reply_thr_put ARGS(( tcp_fd_t *tcp_fd, int reply,
|
||||
int for_ioctl ));
|
||||
FORWARD void reply_thr_get ARGS(( tcp_fd_t *tcp_fd, int reply,
|
||||
static void reply_thr_get ARGS(( tcp_fd_t *tcp_fd, int reply,
|
||||
int for_ioctl ));
|
||||
FORWARD tcp_conn_t *find_conn_entry ARGS(( tcpport_t locport,
|
||||
static tcp_conn_t *find_conn_entry ARGS(( tcpport_t locport,
|
||||
ipaddr_t locaddr, tcpport_t remport, ipaddr_t readaddr ));
|
||||
FORWARD tcp_conn_t *find_empty_conn ARGS(( void ));
|
||||
FORWARD tcp_conn_t *find_best_conn ARGS(( ip_hdr_t *ip_hdr,
|
||||
static tcp_conn_t *find_empty_conn ARGS(( void ));
|
||||
static tcp_conn_t *find_best_conn ARGS(( ip_hdr_t *ip_hdr,
|
||||
tcp_hdr_t *tcp_hdr ));
|
||||
FORWARD tcp_conn_t *new_conn_for_queue ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD int maybe_listen ARGS(( ipaddr_t locaddr, tcpport_t locport,
|
||||
static tcp_conn_t *new_conn_for_queue ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static int maybe_listen ARGS(( ipaddr_t locaddr, tcpport_t locport,
|
||||
ipaddr_t remaddr, tcpport_t remport ));
|
||||
FORWARD int tcp_su4connect ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD void tcp_buffree ARGS(( int priority ));
|
||||
static int tcp_su4connect ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static void tcp_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void tcp_bufcheck ARGS(( void ));
|
||||
static void tcp_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
FORWARD void tcp_setup_conn ARGS(( tcp_port_t *tcp_port,
|
||||
static void tcp_setup_conn ARGS(( tcp_port_t *tcp_port,
|
||||
tcp_conn_t *tcp_conn ));
|
||||
FORWARD u32_t tcp_rand32 ARGS(( void ));
|
||||
static u32_t tcp_rand32 ARGS(( void ));
|
||||
|
||||
PUBLIC void tcp_prep()
|
||||
void tcp_prep()
|
||||
{
|
||||
tcp_port_table= alloc(tcp_conf_nr * sizeof(tcp_port_table[0]));
|
||||
}
|
||||
|
||||
PUBLIC void tcp_init()
|
||||
void tcp_init()
|
||||
{
|
||||
int i, j, k, ifno;
|
||||
tcp_fd_t *tcp_fd;
|
||||
@@ -124,7 +124,7 @@ PUBLIC void tcp_init()
|
||||
tcp_cancel_f= tcp_cancel;
|
||||
}
|
||||
|
||||
PRIVATE void tcp_main(tcp_port)
|
||||
static void tcp_main(tcp_port)
|
||||
tcp_port_t *tcp_port;
|
||||
{
|
||||
int result, i;
|
||||
@@ -245,7 +245,7 @@ tcp_port_t *tcp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int tcp_select(fd, operations)
|
||||
static int tcp_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -341,7 +341,7 @@ unsigned operations;
|
||||
return resops;
|
||||
}
|
||||
|
||||
PRIVATE acc_t *tcp_get_data (port, offset, count, for_ioctl)
|
||||
static acc_t *tcp_get_data (port, offset, count, for_ioctl)
|
||||
int port;
|
||||
size_t offset;
|
||||
size_t count;
|
||||
@@ -435,7 +435,7 @@ assert (count == sizeof(struct nwio_ipopt));
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int tcp_put_data (fd, offset, data, for_ioctl)
|
||||
static int tcp_put_data (fd, offset, data, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -512,7 +512,7 @@ assert (ipconf->nwic_flags & NWIC_IPADDR_SET);
|
||||
tcp_put_pkt
|
||||
*/
|
||||
|
||||
PRIVATE void tcp_put_pkt(fd, data, datalen)
|
||||
static void tcp_put_pkt(fd, data, datalen)
|
||||
int fd;
|
||||
acc_t *data;
|
||||
size_t datalen;
|
||||
@@ -710,7 +710,7 @@ size_t datalen;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int tcp_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
int tcp_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port;
|
||||
int srfd;
|
||||
@@ -754,7 +754,7 @@ select_res_t select_res;
|
||||
/*
|
||||
tcp_ioctl
|
||||
*/
|
||||
PUBLIC int tcp_ioctl (fd, req)
|
||||
int tcp_ioctl (fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -969,7 +969,7 @@ assert (conf_acc->acc_length == sizeof(*tcp_conf));
|
||||
tcp_setconf
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_setconf(tcp_fd)
|
||||
static int tcp_setconf(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
nwio_tcpconf_t *tcpconf;
|
||||
@@ -1160,7 +1160,7 @@ assert (new_di_flags & NWTC_REMPORT_MASK);
|
||||
tcp_setopt
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_setopt(tcp_fd)
|
||||
static int tcp_setopt(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
nwio_tcpopt_t *tcpopt;
|
||||
@@ -1276,7 +1276,7 @@ assert (data->acc_length == sizeof(nwio_tcpopt_t));
|
||||
}
|
||||
|
||||
|
||||
PRIVATE tcpport_t find_unused_port(int fd)
|
||||
static tcpport_t find_unused_port(int fd)
|
||||
{
|
||||
tcpport_t port, nw_port;
|
||||
|
||||
@@ -1296,7 +1296,7 @@ PRIVATE tcpport_t find_unused_port(int fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int is_unused_port(tcpport_t port)
|
||||
static int is_unused_port(tcpport_t port)
|
||||
{
|
||||
int i;
|
||||
tcp_fd_t *tcp_fd;
|
||||
@@ -1322,7 +1322,7 @@ PRIVATE int is_unused_port(tcpport_t port)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PRIVATE int reply_thr_put(tcp_fd, reply, for_ioctl)
|
||||
static int reply_thr_put(tcp_fd, reply, for_ioctl)
|
||||
tcp_fd_t *tcp_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
@@ -1333,7 +1333,7 @@ int for_ioctl;
|
||||
(acc_t *)0, for_ioctl);
|
||||
}
|
||||
|
||||
PRIVATE void reply_thr_get(tcp_fd, reply, for_ioctl)
|
||||
static void reply_thr_get(tcp_fd, reply, for_ioctl)
|
||||
tcp_fd_t *tcp_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
@@ -1345,7 +1345,7 @@ int for_ioctl;
|
||||
assert (!result);
|
||||
}
|
||||
|
||||
PUBLIC int tcp_su4listen(tcp_fd, tcp_conn, do_listenq)
|
||||
int tcp_su4listen(tcp_fd, tcp_conn, do_listenq)
|
||||
tcp_fd_t *tcp_fd;
|
||||
tcp_conn_t *tcp_conn;
|
||||
int do_listenq;
|
||||
@@ -1384,7 +1384,7 @@ This includes connections that are never used, and connections without a
|
||||
user that are not used for a while.
|
||||
*/
|
||||
|
||||
PRIVATE tcp_conn_t *find_empty_conn()
|
||||
static tcp_conn_t *find_empty_conn()
|
||||
{
|
||||
int i;
|
||||
tcp_conn_t *tcp_conn;
|
||||
@@ -1424,7 +1424,7 @@ If no such connection exists NULL is returned.
|
||||
If a connection exists without mainuser it is closed.
|
||||
*/
|
||||
|
||||
PRIVATE tcp_conn_t *find_conn_entry(
|
||||
static tcp_conn_t *find_conn_entry(
|
||||
tcpport_t locport,
|
||||
ipaddr_t locaddr,
|
||||
tcpport_t remport,
|
||||
@@ -1460,7 +1460,7 @@ PRIVATE tcp_conn_t *find_conn_entry(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE void read_ip_packets(tcp_port)
|
||||
static void read_ip_packets(tcp_port)
|
||||
tcp_port_t *tcp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -1483,7 +1483,7 @@ tcp_port_t *tcp_port;
|
||||
find_best_conn
|
||||
*/
|
||||
|
||||
PRIVATE tcp_conn_t *find_best_conn(ip_hdr, tcp_hdr)
|
||||
static tcp_conn_t *find_best_conn(ip_hdr, tcp_hdr)
|
||||
ip_hdr_t *ip_hdr;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
{
|
||||
@@ -1654,7 +1654,7 @@ tcp_hdr_t *tcp_hdr;
|
||||
/*
|
||||
new_conn_for_queue
|
||||
*/
|
||||
PRIVATE tcp_conn_t *new_conn_for_queue(tcp_fd)
|
||||
static tcp_conn_t *new_conn_for_queue(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
int i;
|
||||
@@ -1681,7 +1681,7 @@ tcp_fd_t *tcp_fd;
|
||||
/*
|
||||
maybe_listen
|
||||
*/
|
||||
PRIVATE int maybe_listen(
|
||||
static int maybe_listen(
|
||||
ipaddr_t locaddr,
|
||||
tcpport_t locport,
|
||||
ipaddr_t remaddr,
|
||||
@@ -1730,7 +1730,7 @@ PRIVATE int maybe_listen(
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void tcp_reply_ioctl(tcp_fd, reply)
|
||||
void tcp_reply_ioctl(tcp_fd, reply)
|
||||
tcp_fd_t *tcp_fd;
|
||||
int reply;
|
||||
{
|
||||
@@ -1745,7 +1745,7 @@ int reply;
|
||||
reply_thr_get (tcp_fd, reply, TRUE);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_reply_write(tcp_fd, reply)
|
||||
void tcp_reply_write(tcp_fd, reply)
|
||||
tcp_fd_t *tcp_fd;
|
||||
size_t reply;
|
||||
{
|
||||
@@ -1755,7 +1755,7 @@ size_t reply;
|
||||
reply_thr_get (tcp_fd, reply, FALSE);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_reply_read(tcp_fd, reply)
|
||||
void tcp_reply_read(tcp_fd, reply)
|
||||
tcp_fd_t *tcp_fd;
|
||||
size_t reply;
|
||||
{
|
||||
@@ -1765,7 +1765,7 @@ size_t reply;
|
||||
reply_thr_put (tcp_fd, reply, FALSE);
|
||||
}
|
||||
|
||||
PUBLIC int tcp_write(fd, count)
|
||||
int tcp_write(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -1818,7 +1818,7 @@ size_t count;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PUBLIC int
|
||||
int
|
||||
tcp_read(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
@@ -1858,7 +1858,7 @@ reply the success or failure of a connect to the user.
|
||||
*/
|
||||
|
||||
|
||||
PUBLIC void tcp_restart_connect(tcp_conn)
|
||||
void tcp_restart_connect(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
tcp_fd_t *tcp_fd;
|
||||
@@ -1932,7 +1932,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_close
|
||||
*/
|
||||
|
||||
PUBLIC void tcp_close(fd)
|
||||
void tcp_close(fd)
|
||||
int fd;
|
||||
{
|
||||
int i;
|
||||
@@ -2029,7 +2029,7 @@ int fd;
|
||||
tcp_close_connection(tcp_conn, ENOTCONN);
|
||||
}
|
||||
|
||||
PUBLIC int tcp_cancel(fd, which_operation)
|
||||
int tcp_cancel(fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -2108,7 +2108,7 @@ assert (tcp_fd->tf_flags & TFF_IOCTL_IP);
|
||||
tcp_connect
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_connect(tcp_fd)
|
||||
static int tcp_connect(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
tcp_conn_t *tcp_conn;
|
||||
@@ -2192,7 +2192,7 @@ tcp_fd_t *tcp_fd;
|
||||
tcp_su4connect
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_su4connect(tcp_fd)
|
||||
static int tcp_su4connect(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
tcp_conn_t *tcp_conn;
|
||||
@@ -2231,7 +2231,7 @@ tcp_fd_t *tcp_fd;
|
||||
tcp_listen
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_listen(tcp_fd, do_listenq)
|
||||
static int tcp_listen(tcp_fd, do_listenq)
|
||||
tcp_fd_t *tcp_fd;
|
||||
int do_listenq;
|
||||
{
|
||||
@@ -2284,7 +2284,7 @@ int do_listenq;
|
||||
tcp_acceptto
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_acceptto(tcp_fd)
|
||||
static int tcp_acceptto(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
int i, dst_nr;
|
||||
@@ -2357,7 +2357,7 @@ tcp_fd_t *tcp_fd;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void tcp_buffree (priority)
|
||||
static void tcp_buffree (priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -2440,7 +2440,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void tcp_bufcheck()
|
||||
static void tcp_bufcheck()
|
||||
{
|
||||
int i;
|
||||
tcp_conn_t *tcp_conn;
|
||||
@@ -2470,7 +2470,7 @@ PRIVATE void tcp_bufcheck()
|
||||
}
|
||||
#endif
|
||||
|
||||
PUBLIC void tcp_notreach(tcp_conn, error)
|
||||
void tcp_notreach(tcp_conn, error)
|
||||
tcp_conn_t *tcp_conn;
|
||||
int error;
|
||||
{
|
||||
@@ -2497,7 +2497,7 @@ int error;
|
||||
tcp_conn_write(tcp_conn, 1);
|
||||
}
|
||||
|
||||
FORWARD u32_t mtu_table[]=
|
||||
static u32_t mtu_table[]=
|
||||
{ /* From RFC-1191 */
|
||||
/* Plateau MTU Comments Reference */
|
||||
/* ------ --- -------- --------- */
|
||||
@@ -2535,7 +2535,7 @@ FORWARD u32_t mtu_table[]=
|
||||
0, /* End of list */
|
||||
};
|
||||
|
||||
PUBLIC void tcp_mtu_exceeded(tcp_conn)
|
||||
void tcp_mtu_exceeded(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
u16_t mtu;
|
||||
@@ -2600,7 +2600,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_conn_write(tcp_conn, 1);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_mtu_incr(tcp_conn)
|
||||
void tcp_mtu_incr(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
clock_t curr_time;
|
||||
@@ -2637,7 +2637,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_setup_conn
|
||||
*/
|
||||
|
||||
PRIVATE void tcp_setup_conn(tcp_port, tcp_conn)
|
||||
static void tcp_setup_conn(tcp_port, tcp_conn)
|
||||
tcp_port_t *tcp_port;
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
@@ -2714,7 +2714,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_conn->tc_transmit_seq= 0;
|
||||
}
|
||||
|
||||
PRIVATE u32_t tcp_rand32()
|
||||
static u32_t tcp_rand32()
|
||||
{
|
||||
u8_t bits[RAND256_BUFSIZE];
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Copyright 1995 Philip Homburg
|
||||
THIS_FILE
|
||||
|
||||
#undef tcp_LEmod4G
|
||||
PUBLIC int tcp_LEmod4G(n1, n2)
|
||||
int tcp_LEmod4G(n1, n2)
|
||||
u32_t n1;
|
||||
u32_t n2;
|
||||
{
|
||||
@@ -25,7 +25,7 @@ u32_t n2;
|
||||
}
|
||||
|
||||
#undef tcp_GEmod4G
|
||||
PUBLIC int tcp_GEmod4G(n1, n2)
|
||||
int tcp_GEmod4G(n1, n2)
|
||||
u32_t n1;
|
||||
u32_t n2;
|
||||
{
|
||||
@@ -33,7 +33,7 @@ u32_t n2;
|
||||
}
|
||||
|
||||
#undef tcp_Lmod4G
|
||||
PUBLIC int tcp_Lmod4G(n1, n2)
|
||||
int tcp_Lmod4G(n1, n2)
|
||||
u32_t n1;
|
||||
u32_t n2;
|
||||
{
|
||||
@@ -41,14 +41,14 @@ u32_t n2;
|
||||
}
|
||||
|
||||
#undef tcp_Gmod4G
|
||||
PUBLIC int tcp_Gmod4G(n1, n2)
|
||||
int tcp_Gmod4G(n1, n2)
|
||||
u32_t n1;
|
||||
u32_t n2;
|
||||
{
|
||||
return !!((u32_t)(n2-n1) & 0x80000000L);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_extract_ipopt(tcp_conn, ip_hdr)
|
||||
void tcp_extract_ipopt(tcp_conn, ip_hdr)
|
||||
tcp_conn_t *tcp_conn;
|
||||
ip_hdr_t *ip_hdr;
|
||||
{
|
||||
@@ -61,7 +61,7 @@ ip_hdr_t *ip_hdr;
|
||||
DBLOCK(1, printf("ip_hdr options NOT supported (yet?)\n"));
|
||||
}
|
||||
|
||||
PUBLIC void tcp_extract_tcpopt(tcp_conn, tcp_hdr, mssp)
|
||||
void tcp_extract_tcpopt(tcp_conn, tcp_hdr, mssp)
|
||||
tcp_conn_t *tcp_conn;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
size_t *mssp;
|
||||
@@ -119,7 +119,7 @@ size_t *mssp;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC u16_t tcp_pack_oneCsum(ip_hdr, tcp_pack)
|
||||
u16_t tcp_pack_oneCsum(ip_hdr, tcp_pack)
|
||||
ip_hdr_t *ip_hdr;
|
||||
acc_t *tcp_pack;
|
||||
{
|
||||
@@ -165,7 +165,7 @@ acc_t *tcp_pack;
|
||||
return sum;
|
||||
}
|
||||
|
||||
PUBLIC void tcp_get_ipopt(tcp_conn, ip_hdropt)
|
||||
void tcp_get_ipopt(tcp_conn, ip_hdropt)
|
||||
tcp_conn_t *tcp_conn;
|
||||
ip_hdropt_t *ip_hdropt;
|
||||
{
|
||||
@@ -179,7 +179,7 @@ ip_hdropt_t *ip_hdropt;
|
||||
return;
|
||||
}
|
||||
|
||||
PUBLIC void tcp_get_tcpopt(tcp_conn, tcp_hdropt)
|
||||
void tcp_get_tcpopt(tcp_conn, tcp_hdropt)
|
||||
tcp_conn_t *tcp_conn;
|
||||
tcp_hdropt_t *tcp_hdropt;
|
||||
{
|
||||
@@ -204,7 +204,7 @@ tcp_hdropt_t *tcp_hdropt;
|
||||
return;
|
||||
}
|
||||
|
||||
PUBLIC acc_t *tcp_make_header(tcp_conn, ref_ip_hdr, ref_tcp_hdr, data)
|
||||
acc_t *tcp_make_header(tcp_conn, ref_ip_hdr, ref_tcp_hdr, data)
|
||||
tcp_conn_t *tcp_conn;
|
||||
ip_hdr_t **ref_ip_hdr;
|
||||
tcp_hdr_t **ref_tcp_hdr;
|
||||
@@ -295,7 +295,7 @@ acc_t *data;
|
||||
return hdr_acc;
|
||||
}
|
||||
|
||||
PUBLIC void tcp_print_state (tcp_conn)
|
||||
void tcp_print_state (tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
#if DEBUG
|
||||
@@ -319,7 +319,7 @@ tcp_conn_t *tcp_conn;
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC int tcp_check_conn(tcp_conn)
|
||||
int tcp_check_conn(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
int allright;
|
||||
@@ -480,7 +480,7 @@ tcp_conn_t *tcp_conn;
|
||||
return allright;
|
||||
}
|
||||
|
||||
PUBLIC void tcp_print_pack(ip_hdr, tcp_hdr)
|
||||
void tcp_print_pack(ip_hdr, tcp_hdr)
|
||||
ip_hdr_t *ip_hdr;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
{
|
||||
@@ -516,7 +516,7 @@ tcp_hdr_t *tcp_hdr;
|
||||
printf(" <options %d>", tcp_hdr_len-TCP_MIN_HDR_SIZE);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_print_conn(tcp_conn)
|
||||
void tcp_print_conn(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
u32_t iss, irs;
|
||||
|
||||
@@ -18,14 +18,14 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void create_RST ARGS(( tcp_conn_t *tcp_conn,
|
||||
static void create_RST ARGS(( tcp_conn_t *tcp_conn,
|
||||
ip_hdr_t *ip_hdr, tcp_hdr_t *tcp_hdr, int data_len ));
|
||||
FORWARD void process_data ARGS(( tcp_conn_t *tcp_conn,
|
||||
static void process_data ARGS(( tcp_conn_t *tcp_conn,
|
||||
tcp_hdr_t *tcp_hdr, acc_t *tcp_data, int data_len ));
|
||||
FORWARD void process_advanced_data ARGS(( tcp_conn_t *tcp_conn,
|
||||
static void process_advanced_data ARGS(( tcp_conn_t *tcp_conn,
|
||||
tcp_hdr_t *tcp_hdr, acc_t *tcp_data, int data_len ));
|
||||
|
||||
PUBLIC void tcp_frag2conn(tcp_conn, ip_hdr, tcp_hdr, tcp_data, data_len)
|
||||
void tcp_frag2conn(tcp_conn, ip_hdr, tcp_hdr, tcp_data, data_len)
|
||||
tcp_conn_t *tcp_conn;
|
||||
ip_hdr_t *ip_hdr;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
@@ -796,7 +796,7 @@ TIME-WAIT:
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void
|
||||
static void
|
||||
process_data(tcp_conn, tcp_hdr, tcp_data, data_len)
|
||||
tcp_conn_t *tcp_conn;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
@@ -1058,7 +1058,7 @@ int data_len;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void process_advanced_data(tcp_conn, tcp_hdr, tcp_data, data_len)
|
||||
static void process_advanced_data(tcp_conn, tcp_hdr, tcp_data, data_len)
|
||||
tcp_conn_t *tcp_conn;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
acc_t *tcp_data;
|
||||
@@ -1120,7 +1120,7 @@ int data_len;
|
||||
tcp_conn->tc_adv_seq= adv_seq;
|
||||
}
|
||||
|
||||
PRIVATE void create_RST(tcp_conn, ip_hdr, tcp_hdr, data_len)
|
||||
static void create_RST(tcp_conn, ip_hdr, tcp_hdr, data_len)
|
||||
tcp_conn_t *tcp_conn;
|
||||
ip_hdr_t *ip_hdr;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
@@ -1218,7 +1218,7 @@ int data_len;
|
||||
tcp_conn_write(tcp_conn, 1);
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
void
|
||||
tcp_fd_read(tcp_conn, enq)
|
||||
tcp_conn_t *tcp_conn;
|
||||
int enq; /* Enqueue writes. */
|
||||
@@ -1390,7 +1390,7 @@ int enq; /* Enqueue writes. */
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC unsigned
|
||||
unsigned
|
||||
tcp_sel_read(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
@@ -1426,7 +1426,7 @@ tcp_conn_t *tcp_conn;
|
||||
return 1;
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
void
|
||||
tcp_rsel_read(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
@@ -1443,7 +1443,7 @@ tcp_conn_t *tcp_conn;
|
||||
printf("tcp_rsel_read: no select_res\n");
|
||||
}
|
||||
|
||||
PUBLIC void tcp_bytesavailable(tcp_fd, bytesp)
|
||||
void tcp_bytesavailable(tcp_fd, bytesp)
|
||||
tcp_fd_t *tcp_fd;
|
||||
int *bytesp;
|
||||
{
|
||||
|
||||
@@ -19,11 +19,11 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD acc_t *make_pack ARGS(( tcp_conn_t *tcp_conn ));
|
||||
FORWARD void tcp_send_timeout ARGS(( int conn, struct timer *timer ));
|
||||
FORWARD void do_snd_event ARGS(( event_t *ev, ev_arg_t arg ));
|
||||
static acc_t *make_pack ARGS(( tcp_conn_t *tcp_conn ));
|
||||
static void tcp_send_timeout ARGS(( int conn, struct timer *timer ));
|
||||
static void do_snd_event ARGS(( event_t *ev, ev_arg_t arg ));
|
||||
|
||||
PUBLIC void tcp_conn_write (tcp_conn, enq)
|
||||
void tcp_conn_write (tcp_conn, enq)
|
||||
tcp_conn_t *tcp_conn;
|
||||
int enq; /* Writes need to be enqueued. */
|
||||
{
|
||||
@@ -69,7 +69,7 @@ int enq; /* Writes need to be enqueued. */
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void do_snd_event(ev, arg)
|
||||
static void do_snd_event(ev, arg)
|
||||
event_t *ev;
|
||||
ev_arg_t arg;
|
||||
{
|
||||
@@ -81,7 +81,7 @@ ev_arg_t arg;
|
||||
tcp_port_write(tcp_port);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_port_write(tcp_port)
|
||||
void tcp_port_write(tcp_port)
|
||||
tcp_port_t *tcp_port;
|
||||
{
|
||||
tcp_conn_t *tcp_conn;
|
||||
@@ -158,7 +158,7 @@ tcp_port_t *tcp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE acc_t *make_pack(tcp_conn)
|
||||
static acc_t *make_pack(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
acc_t *pack2write, *tmp_pack, *tcp_pack;
|
||||
@@ -530,7 +530,7 @@ after_data:
|
||||
tcp_release_retrans
|
||||
*/
|
||||
|
||||
PUBLIC void tcp_release_retrans(
|
||||
void tcp_release_retrans(
|
||||
tcp_conn_t *tcp_conn,
|
||||
u32_t seg_ack,
|
||||
u16_t new_win
|
||||
@@ -766,7 +766,7 @@ PUBLIC void tcp_release_retrans(
|
||||
tcp_fast_retrans
|
||||
*/
|
||||
|
||||
PUBLIC void tcp_fast_retrans(tcp_conn)
|
||||
void tcp_fast_retrans(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
u16_t mss, mss2;
|
||||
@@ -797,7 +797,7 @@ tcp_conn_t *tcp_conn;
|
||||
}
|
||||
|
||||
#if 0
|
||||
PUBLIC void do_tcp_timeout(tcp_conn)
|
||||
void do_tcp_timeout(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
tcp_send_timeout(tcp_conn-tcp_conn_table,
|
||||
@@ -809,7 +809,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_send_timeout
|
||||
*/
|
||||
|
||||
PRIVATE void tcp_send_timeout(conn, timer)
|
||||
static void tcp_send_timeout(conn, timer)
|
||||
int conn;
|
||||
struct timer *timer;
|
||||
{
|
||||
@@ -1060,7 +1060,7 @@ struct timer *timer;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void tcp_fd_write(tcp_conn)
|
||||
void tcp_fd_write(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
tcp_fd_t *tcp_fd;
|
||||
@@ -1182,7 +1182,7 @@ tcp_conn_t *tcp_conn;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC unsigned tcp_sel_write(tcp_conn)
|
||||
unsigned tcp_sel_write(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
tcp_fd_t *tcp_fd;
|
||||
@@ -1222,7 +1222,7 @@ tcp_conn_t *tcp_conn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
void
|
||||
tcp_rsel_write(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
@@ -1243,7 +1243,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_shutdown
|
||||
*/
|
||||
|
||||
PUBLIC void tcp_shutdown(tcp_conn)
|
||||
void tcp_shutdown(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
switch (tcp_conn->tc_state)
|
||||
@@ -1272,7 +1272,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_set_send_timer(tcp_conn);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_set_send_timer(tcp_conn)
|
||||
void tcp_set_send_timer(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
clock_t curr_time;
|
||||
@@ -1300,7 +1300,7 @@ tcp_close_connection
|
||||
|
||||
*/
|
||||
|
||||
PUBLIC void tcp_close_connection(tcp_conn, error)
|
||||
void tcp_close_connection(tcp_conn, error)
|
||||
tcp_conn_t *tcp_conn;
|
||||
int error;
|
||||
{
|
||||
|
||||
@@ -19,45 +19,45 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void read_ip_packets ARGS(( udp_port_t *udp_port ));
|
||||
FORWARD void udp_buffree ARGS(( int priority ));
|
||||
static void read_ip_packets ARGS(( udp_port_t *udp_port ));
|
||||
static void udp_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void udp_bufcheck ARGS(( void ));
|
||||
static void udp_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
FORWARD void udp_main ARGS(( udp_port_t *udp_port ));
|
||||
FORWARD int udp_select ARGS(( int fd, unsigned operations ));
|
||||
FORWARD acc_t *udp_get_data ARGS(( int fd, size_t offset, size_t count,
|
||||
static void udp_main ARGS(( udp_port_t *udp_port ));
|
||||
static int udp_select ARGS(( int fd, unsigned operations ));
|
||||
static acc_t *udp_get_data ARGS(( int fd, size_t offset, size_t count,
|
||||
int for_ioctl ));
|
||||
FORWARD int udp_put_data ARGS(( int fd, size_t offset, acc_t *data,
|
||||
static int udp_put_data ARGS(( int fd, size_t offset, acc_t *data,
|
||||
int for_ioctl ));
|
||||
FORWARD int udp_peek ARGS(( udp_fd_t * ));
|
||||
FORWARD int udp_sel_read ARGS(( udp_fd_t * ));
|
||||
FORWARD void udp_restart_write_port ARGS(( udp_port_t *udp_port ));
|
||||
FORWARD void udp_ip_arrived ARGS(( int port, acc_t *pack, size_t pack_size ));
|
||||
FORWARD void reply_thr_put ARGS(( udp_fd_t *udp_fd, int reply,
|
||||
static int udp_peek ARGS(( udp_fd_t * ));
|
||||
static int udp_sel_read ARGS(( udp_fd_t * ));
|
||||
static void udp_restart_write_port ARGS(( udp_port_t *udp_port ));
|
||||
static void udp_ip_arrived ARGS(( int port, acc_t *pack, size_t pack_size ));
|
||||
static void reply_thr_put ARGS(( udp_fd_t *udp_fd, int reply,
|
||||
int for_ioctl ));
|
||||
FORWARD void reply_thr_get ARGS(( udp_fd_t *udp_fd, int reply,
|
||||
static void reply_thr_get ARGS(( udp_fd_t *udp_fd, int reply,
|
||||
int for_ioctl ));
|
||||
FORWARD int udp_setopt ARGS(( udp_fd_t *udp_fd ));
|
||||
FORWARD udpport_t find_unused_port ARGS(( int fd ));
|
||||
FORWARD int is_unused_port ARGS(( udpport_t port ));
|
||||
FORWARD int udp_packet2user ARGS(( udp_fd_t *udp_fd ));
|
||||
FORWARD void restart_write_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
FORWARD u16_t pack_oneCsum ARGS(( acc_t *pack ));
|
||||
FORWARD void udp_rd_enqueue ARGS(( udp_fd_t *udp_fd, acc_t *pack,
|
||||
static int udp_setopt ARGS(( udp_fd_t *udp_fd ));
|
||||
static udpport_t find_unused_port ARGS(( int fd ));
|
||||
static int is_unused_port ARGS(( udpport_t port ));
|
||||
static int udp_packet2user ARGS(( udp_fd_t *udp_fd ));
|
||||
static void restart_write_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
static u16_t pack_oneCsum ARGS(( acc_t *pack ));
|
||||
static void udp_rd_enqueue ARGS(( udp_fd_t *udp_fd, acc_t *pack,
|
||||
clock_t exp_tim ));
|
||||
FORWARD void hash_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
FORWARD void unhash_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
static void hash_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
static void unhash_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
|
||||
PUBLIC udp_port_t *udp_port_table;
|
||||
PUBLIC udp_fd_t udp_fd_table[UDP_FD_NR];
|
||||
udp_port_t *udp_port_table;
|
||||
udp_fd_t udp_fd_table[UDP_FD_NR];
|
||||
|
||||
PUBLIC void udp_prep()
|
||||
void udp_prep()
|
||||
{
|
||||
udp_port_table= alloc(udp_conf_nr * sizeof(udp_port_table[0]));
|
||||
}
|
||||
|
||||
PUBLIC void udp_init()
|
||||
void udp_init()
|
||||
{
|
||||
udp_fd_t *udp_fd;
|
||||
udp_port_t *udp_port;
|
||||
@@ -104,7 +104,7 @@ PUBLIC void udp_init()
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC int udp_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
int udp_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port;
|
||||
int srfd;
|
||||
@@ -141,7 +141,7 @@ select_res_t select_res;
|
||||
|
||||
}
|
||||
|
||||
PUBLIC int udp_ioctl (fd, req)
|
||||
int udp_ioctl (fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -192,7 +192,7 @@ assert (opt_acc->acc_length == sizeof(*udp_opt));
|
||||
return result;
|
||||
}
|
||||
|
||||
PUBLIC int udp_read (fd, count)
|
||||
int udp_read (fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -225,7 +225,7 @@ size_t count;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PRIVATE void udp_main(udp_port)
|
||||
static void udp_main(udp_port)
|
||||
udp_port_t *udp_port;
|
||||
{
|
||||
udp_fd_t *udp_fd;
|
||||
@@ -292,7 +292,7 @@ udp_port_t *udp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int udp_select(fd, operations)
|
||||
static int udp_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -323,7 +323,7 @@ unsigned operations;
|
||||
return resops;
|
||||
}
|
||||
|
||||
PRIVATE acc_t *udp_get_data (port, offset, count, for_ioctl)
|
||||
static acc_t *udp_get_data (port, offset, count, for_ioctl)
|
||||
int port;
|
||||
size_t offset;
|
||||
size_t count;
|
||||
@@ -409,7 +409,7 @@ assert (udp_port->up_wr_pack);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE int udp_put_data (fd, offset, data, for_ioctl)
|
||||
static int udp_put_data (fd, offset, data, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -478,7 +478,7 @@ assert (!offset); /* This isn't a valid assertion but ip sends only
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int udp_setopt(udp_fd)
|
||||
static int udp_setopt(udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
udp_fd_t *fd_ptr;
|
||||
@@ -676,7 +676,7 @@ assert (data->acc_length == sizeof(nwio_udpopt_t));
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE udpport_t find_unused_port(int fd)
|
||||
static udpport_t find_unused_port(int fd)
|
||||
{
|
||||
udpport_t port, nw_port;
|
||||
|
||||
@@ -700,7 +700,7 @@ PRIVATE udpport_t find_unused_port(int fd)
|
||||
reply_thr_put
|
||||
*/
|
||||
|
||||
PRIVATE void reply_thr_put(udp_fd, reply, for_ioctl)
|
||||
static void reply_thr_put(udp_fd, reply, for_ioctl)
|
||||
udp_fd_t *udp_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
@@ -716,7 +716,7 @@ int for_ioctl;
|
||||
reply_thr_get
|
||||
*/
|
||||
|
||||
PRIVATE void reply_thr_get(udp_fd, reply, for_ioctl)
|
||||
static void reply_thr_get(udp_fd, reply, for_ioctl)
|
||||
udp_fd_t *udp_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
@@ -727,7 +727,7 @@ int for_ioctl;
|
||||
assert (!result);
|
||||
}
|
||||
|
||||
PRIVATE int is_unused_port(udpport_t port)
|
||||
static int is_unused_port(udpport_t port)
|
||||
{
|
||||
int i;
|
||||
udp_fd_t *udp_fd;
|
||||
@@ -743,7 +743,7 @@ PRIVATE int is_unused_port(udpport_t port)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PRIVATE void read_ip_packets(udp_port)
|
||||
static void read_ip_packets(udp_port)
|
||||
udp_port_t *udp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -763,7 +763,7 @@ assert(result == NW_OK);
|
||||
}
|
||||
|
||||
|
||||
PRIVATE int udp_peek (udp_fd)
|
||||
static int udp_peek (udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
acc_t *pack, *tmp_acc, *next_acc;
|
||||
@@ -804,7 +804,7 @@ udp_fd_t *udp_fd;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PRIVATE int udp_sel_read (udp_fd_t *udp_fd)
|
||||
static int udp_sel_read (udp_fd_t *udp_fd)
|
||||
{
|
||||
acc_t *tmp_acc, *next_acc;
|
||||
|
||||
@@ -828,7 +828,7 @@ PRIVATE int udp_sel_read (udp_fd_t *udp_fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int udp_packet2user (udp_fd)
|
||||
static int udp_packet2user (udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
acc_t *pack, *tmp_pack;
|
||||
@@ -889,7 +889,7 @@ udp_fd_t *udp_fd;
|
||||
return result;
|
||||
}
|
||||
|
||||
PRIVATE void udp_ip_arrived(port, pack, pack_size)
|
||||
static void udp_ip_arrived(port, pack, pack_size)
|
||||
int port;
|
||||
acc_t *pack;
|
||||
size_t pack_size;
|
||||
@@ -1158,7 +1158,7 @@ size_t pack_size;
|
||||
bf_afree(udp_acc);
|
||||
}
|
||||
|
||||
PUBLIC void udp_close(fd)
|
||||
void udp_close(fd)
|
||||
int fd;
|
||||
{
|
||||
udp_fd_t *udp_fd;
|
||||
@@ -1182,7 +1182,7 @@ int fd;
|
||||
udp_fd->uf_rdbuf_head= NULL;
|
||||
}
|
||||
|
||||
PUBLIC int udp_write(int fd, size_t count)
|
||||
int udp_write(int fd, size_t count)
|
||||
{
|
||||
udp_fd_t *udp_fd;
|
||||
|
||||
@@ -1214,7 +1214,7 @@ assert (!(udp_fd->uf_flags & UFF_WRITE_IP));
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void restart_write_fd(udp_fd)
|
||||
static void restart_write_fd(udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
udp_port_t *udp_port;
|
||||
@@ -1375,7 +1375,7 @@ assert (!(udp_port->up_flags & UPF_WRITE_IP));
|
||||
reply_thr_get (udp_fd, udp_fd->uf_wr_count, FALSE);
|
||||
}
|
||||
|
||||
PRIVATE u16_t pack_oneCsum(pack)
|
||||
static u16_t pack_oneCsum(pack)
|
||||
acc_t *pack;
|
||||
{
|
||||
u16_t prev;
|
||||
@@ -1423,7 +1423,7 @@ acc_t *pack;
|
||||
return prev;
|
||||
}
|
||||
|
||||
PRIVATE void udp_restart_write_port(udp_port )
|
||||
static void udp_restart_write_port(udp_port )
|
||||
udp_port_t *udp_port;
|
||||
{
|
||||
udp_fd_t *udp_fd;
|
||||
@@ -1459,7 +1459,7 @@ assert (!(udp_port->up_flags & (UPF_WRITE_IP|UPF_WRITE_SP)));
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC int udp_cancel(fd, which_operation)
|
||||
int udp_cancel(fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -1495,7 +1495,7 @@ assert (udp_fd->uf_flags & UFF_IOCTL_IP);
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void udp_buffree (priority)
|
||||
static void udp_buffree (priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -1530,7 +1530,7 @@ int priority;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void udp_rd_enqueue(udp_fd, pack, exp_tim)
|
||||
static void udp_rd_enqueue(udp_fd, pack, exp_tim)
|
||||
udp_fd_t *udp_fd;
|
||||
acc_t *pack;
|
||||
clock_t exp_tim;
|
||||
@@ -1578,7 +1578,7 @@ clock_t exp_tim;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void hash_fd(udp_fd)
|
||||
static void hash_fd(udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
udp_port_t *udp_port;
|
||||
@@ -1602,7 +1602,7 @@ udp_fd_t *udp_fd;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void unhash_fd(udp_fd)
|
||||
static void unhash_fd(udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
udp_port_t *udp_port;
|
||||
@@ -1637,7 +1637,7 @@ udp_fd_t *udp_fd;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void udp_bufcheck()
|
||||
static void udp_bufcheck()
|
||||
{
|
||||
int i;
|
||||
udp_port_t *udp_port;
|
||||
|
||||
@@ -82,15 +82,15 @@ extern int inet_buf_debug;
|
||||
u32_t system_hz;
|
||||
#endif
|
||||
|
||||
FORWARD void nw_conf(void);
|
||||
FORWARD void nw_init(void);
|
||||
FORWARD void ds_event(void);
|
||||
static void nw_conf(void);
|
||||
static void nw_init(void);
|
||||
static void ds_event(void);
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
static void sef_local_startup(void);
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
|
||||
PUBLIC int main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
mq_t *mq;
|
||||
int ipc_status;
|
||||
@@ -188,7 +188,7 @@ PUBLIC int main(int argc, char *argv[])
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -203,7 +203,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
{
|
||||
/* Initialize the inet server. */
|
||||
int r;
|
||||
@@ -301,7 +301,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
return(OK);
|
||||
}
|
||||
|
||||
PRIVATE void nw_conf()
|
||||
static void nw_conf()
|
||||
{
|
||||
read_conf();
|
||||
eth_prep();
|
||||
@@ -312,7 +312,7 @@ PRIVATE void nw_conf()
|
||||
udp_prep();
|
||||
}
|
||||
|
||||
PRIVATE void nw_init()
|
||||
static void nw_init()
|
||||
{
|
||||
mq_init();
|
||||
bf_init();
|
||||
@@ -330,7 +330,7 @@ PRIVATE void nw_init()
|
||||
/*===========================================================================*
|
||||
* ds_event *
|
||||
*===========================================================================*/
|
||||
PRIVATE void ds_event()
|
||||
static void ds_event()
|
||||
{
|
||||
char key[DS_MAX_KEYLEN];
|
||||
char *driver_prefix = "drv.net.";
|
||||
@@ -370,14 +370,14 @@ PRIVATE void ds_event()
|
||||
printf("inet: ds_event: ds_check failed: %d\n", r);
|
||||
}
|
||||
|
||||
PUBLIC void panic0(file, line)
|
||||
void panic0(file, line)
|
||||
char *file;
|
||||
int line;
|
||||
{
|
||||
printf("panic at %s, %d: ", file, line);
|
||||
}
|
||||
|
||||
PUBLIC void inet_panic()
|
||||
void inet_panic()
|
||||
{
|
||||
printf("\ninet stacktrace: ");
|
||||
util_stacktrace();
|
||||
@@ -386,7 +386,7 @@ PUBLIC void inet_panic()
|
||||
}
|
||||
|
||||
#if !NDEBUG
|
||||
PUBLIC void bad_assertion(file, line, what)
|
||||
void bad_assertion(file, line, what)
|
||||
char *file;
|
||||
int line;
|
||||
char *what;
|
||||
@@ -397,7 +397,7 @@ char *what;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void bad_compare(file, line, lhs, what, rhs)
|
||||
void bad_compare(file, line, lhs, what, rhs)
|
||||
char *file;
|
||||
int line;
|
||||
int lhs;
|
||||
|
||||
@@ -21,14 +21,14 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void setup_read(eth_port_t *eth_port);
|
||||
FORWARD void read_int(eth_port_t *eth_port, int count);
|
||||
FORWARD void eth_issue_send(eth_port_t *eth_port);
|
||||
FORWARD void write_int(eth_port_t *eth_port);
|
||||
FORWARD void eth_restart(eth_port_t *eth_port, endpoint_t endpoint);
|
||||
FORWARD void send_getstat(eth_port_t *eth_port);
|
||||
static void setup_read(eth_port_t *eth_port);
|
||||
static void read_int(eth_port_t *eth_port, int count);
|
||||
static void eth_issue_send(eth_port_t *eth_port);
|
||||
static void write_int(eth_port_t *eth_port);
|
||||
static void eth_restart(eth_port_t *eth_port, endpoint_t endpoint);
|
||||
static void send_getstat(eth_port_t *eth_port);
|
||||
|
||||
PUBLIC void osdep_eth_init()
|
||||
void osdep_eth_init()
|
||||
{
|
||||
int i, j, rport;
|
||||
struct eth_conf *ecp;
|
||||
@@ -155,7 +155,7 @@ PUBLIC void osdep_eth_init()
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void eth_write_port(eth_port, pack)
|
||||
void eth_write_port(eth_port, pack)
|
||||
eth_port_t *eth_port;
|
||||
acc_t *pack;
|
||||
{
|
||||
@@ -175,7 +175,7 @@ acc_t *pack;
|
||||
eth_issue_send(eth_port);
|
||||
}
|
||||
|
||||
PUBLIC void eth_rec(message *m)
|
||||
void eth_rec(message *m)
|
||||
{
|
||||
int i, r, m_type, flags;
|
||||
eth_port_t *loc_port, *vlan_port;
|
||||
@@ -362,7 +362,7 @@ PUBLIC void eth_rec(message *m)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void eth_check_driver(char *label, endpoint_t endpoint)
|
||||
void eth_check_driver(char *label, endpoint_t endpoint)
|
||||
{
|
||||
int i;
|
||||
eth_port_t *loc_port;
|
||||
@@ -384,7 +384,7 @@ PUBLIC void eth_check_driver(char *label, endpoint_t endpoint)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC int eth_get_stat(eth_port, eth_stat)
|
||||
int eth_get_stat(eth_port, eth_stat)
|
||||
eth_port_t *eth_port;
|
||||
eth_stat_t *eth_stat;
|
||||
{
|
||||
@@ -417,7 +417,7 @@ eth_stat_t *eth_stat;
|
||||
return SUSPEND;
|
||||
}
|
||||
|
||||
PUBLIC void eth_set_rec_conf (eth_port, flags)
|
||||
void eth_set_rec_conf (eth_port, flags)
|
||||
eth_port_t *eth_port;
|
||||
u32_t flags;
|
||||
{
|
||||
@@ -478,7 +478,7 @@ u32_t flags;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void eth_issue_send(eth_port)
|
||||
static void eth_issue_send(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
int i, r, pack_size;
|
||||
@@ -557,7 +557,7 @@ eth_port_t *eth_port;
|
||||
eth_port->etp_osdep.etp_state= OEPS_SEND_SENT;
|
||||
}
|
||||
|
||||
PRIVATE void write_int(eth_port_t *eth_port)
|
||||
static void write_int(eth_port_t *eth_port)
|
||||
{
|
||||
acc_t *pack;
|
||||
int multicast;
|
||||
@@ -590,7 +590,7 @@ PRIVATE void write_int(eth_port_t *eth_port)
|
||||
eth_restart_write(eth_port);
|
||||
}
|
||||
|
||||
PRIVATE void read_int(eth_port, count)
|
||||
static void read_int(eth_port, count)
|
||||
eth_port_t *eth_port;
|
||||
int count;
|
||||
{
|
||||
@@ -654,7 +654,7 @@ int count;
|
||||
setup_read(eth_port);
|
||||
}
|
||||
|
||||
PRIVATE void setup_read(eth_port)
|
||||
static void setup_read(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
acc_t *pack, *pack_ptr;
|
||||
@@ -812,7 +812,7 @@ static void eth_restart(eth_port_t *eth_port, endpoint_t endpoint)
|
||||
|
||||
}
|
||||
|
||||
PRIVATE void send_getstat(eth_port)
|
||||
static void send_getstat(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -14,8 +14,8 @@ THIS_FILE
|
||||
|
||||
#define MQ_SIZE 128
|
||||
|
||||
PRIVATE mq_t mq_list[MQ_SIZE];
|
||||
PRIVATE mq_t *mq_freelist;
|
||||
static mq_t mq_list[MQ_SIZE];
|
||||
static mq_t *mq_freelist;
|
||||
|
||||
void mq_init()
|
||||
{
|
||||
|
||||
@@ -42,9 +42,9 @@ typedef struct qp_fd
|
||||
#define QFF_EMPTY 0
|
||||
#define QFF_INUSE 1
|
||||
|
||||
PRIVATE qp_fd_t qp_fd_table[QP_FD_NR];
|
||||
static qp_fd_t qp_fd_table[QP_FD_NR];
|
||||
|
||||
PRIVATE struct export_param_list inet_ex_list[]=
|
||||
static struct export_param_list inet_ex_list[]=
|
||||
{
|
||||
QP_VARIABLE(sr_fd_table),
|
||||
QP_VARIABLE(ip_dev),
|
||||
@@ -56,9 +56,9 @@ PRIVATE struct export_param_list inet_ex_list[]=
|
||||
QP_END()
|
||||
};
|
||||
|
||||
PRIVATE struct export_params inet_ex_params= { inet_ex_list, NULL };
|
||||
static struct export_params inet_ex_params= { inet_ex_list, NULL };
|
||||
|
||||
PRIVATE struct queryvars {
|
||||
static struct queryvars {
|
||||
/* Input */
|
||||
acc_t *param;
|
||||
|
||||
@@ -73,25 +73,25 @@ PRIVATE struct queryvars {
|
||||
} *qvars;
|
||||
|
||||
|
||||
FORWARD int qp_open ARGS(( int port, int srfd,
|
||||
static int qp_open ARGS(( int port, int srfd,
|
||||
get_userdata_t get_userdata, put_userdata_t put_userdata,
|
||||
put_pkt_t put_pkt, select_res_t select_res ));
|
||||
FORWARD void qp_close ARGS(( int fd ));
|
||||
FORWARD int qp_read ARGS(( int fd, size_t count ));
|
||||
FORWARD int qp_write ARGS(( int fd, size_t count ));
|
||||
FORWARD int qp_ioctl ARGS(( int fd, ioreq_t req ));
|
||||
FORWARD int qp_cancel ARGS(( int fd, int which_operation ));
|
||||
FORWARD int qp_select ARGS(( int fd, unsigned operations ));
|
||||
FORWARD qp_fd_t *get_qp_fd ARGS(( int fd ));
|
||||
FORWARD int do_query ARGS(( qp_fd_t *qp_fd, acc_t *pkt, int count ));
|
||||
FORWARD int qp_getc ARGS(( void ));
|
||||
FORWARD void qp_putc ARGS(( struct queryvars *qv, int c ));
|
||||
FORWARD void qp_buffree ARGS(( int priority ));
|
||||
static void qp_close ARGS(( int fd ));
|
||||
static int qp_read ARGS(( int fd, size_t count ));
|
||||
static int qp_write ARGS(( int fd, size_t count ));
|
||||
static int qp_ioctl ARGS(( int fd, ioreq_t req ));
|
||||
static int qp_cancel ARGS(( int fd, int which_operation ));
|
||||
static int qp_select ARGS(( int fd, unsigned operations ));
|
||||
static qp_fd_t *get_qp_fd ARGS(( int fd ));
|
||||
static int do_query ARGS(( qp_fd_t *qp_fd, acc_t *pkt, int count ));
|
||||
static int qp_getc ARGS(( void ));
|
||||
static void qp_putc ARGS(( struct queryvars *qv, int c ));
|
||||
static void qp_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void qp_bufcheck ARGS(( void ));
|
||||
static void qp_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
|
||||
PUBLIC void qp_init()
|
||||
void qp_init()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -110,7 +110,7 @@ PUBLIC void qp_init()
|
||||
qp_ioctl, qp_cancel, qp_select);
|
||||
}
|
||||
|
||||
PRIVATE int qp_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
static int qp_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port;
|
||||
int srfd;
|
||||
@@ -139,7 +139,7 @@ select_res_t select_res;
|
||||
return i;
|
||||
}
|
||||
|
||||
PRIVATE void qp_close(fd)
|
||||
static void qp_close(fd)
|
||||
int fd;
|
||||
{
|
||||
qp_fd_t *qp_fd;
|
||||
@@ -153,7 +153,7 @@ int fd;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int qp_read(fd, count)
|
||||
static int qp_read(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -177,7 +177,7 @@ size_t count;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int qp_write(fd, count)
|
||||
static int qp_write(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -210,7 +210,7 @@ size_t count;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int qp_ioctl(fd, req)
|
||||
static int qp_ioctl(fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -222,7 +222,7 @@ ioreq_t req;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int qp_cancel(fd, which_operation)
|
||||
static int qp_cancel(fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -230,7 +230,7 @@ int which_operation;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int qp_select(fd, operations)
|
||||
static int qp_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -244,7 +244,7 @@ unsigned operations;
|
||||
return resops;
|
||||
}
|
||||
|
||||
PRIVATE qp_fd_t *get_qp_fd(fd)
|
||||
static qp_fd_t *get_qp_fd(fd)
|
||||
int fd;
|
||||
{
|
||||
qp_fd_t *qp_fd;
|
||||
@@ -255,7 +255,7 @@ int fd;
|
||||
return qp_fd;
|
||||
}
|
||||
|
||||
PRIVATE int do_query(qp_fd, pkt, count)
|
||||
static int do_query(qp_fd, pkt, count)
|
||||
qp_fd_t *qp_fd;
|
||||
acc_t *pkt;
|
||||
int count;
|
||||
@@ -297,7 +297,7 @@ int count;
|
||||
return qv.fd_offset;
|
||||
}
|
||||
|
||||
PRIVATE int qp_getc()
|
||||
static int qp_getc()
|
||||
{
|
||||
/* Return one character of the names to search for. */
|
||||
acc_t *pkt;
|
||||
@@ -322,7 +322,7 @@ PRIVATE int qp_getc()
|
||||
return c;
|
||||
}
|
||||
|
||||
PRIVATE void qp_putc(qv, c)
|
||||
static void qp_putc(qv, c)
|
||||
struct queryvars *qv;
|
||||
int c;
|
||||
{
|
||||
@@ -358,14 +358,14 @@ int c;
|
||||
qv->outbuf_off= 0;
|
||||
}
|
||||
|
||||
PRIVATE void qp_buffree (priority)
|
||||
static void qp_buffree (priority)
|
||||
int priority;
|
||||
{
|
||||
/* For the moment, we are not going to free anything */
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void qp_bufcheck()
|
||||
static void qp_bufcheck()
|
||||
{
|
||||
int i;
|
||||
qp_fd_t *qp_fd;
|
||||
|
||||
@@ -70,37 +70,37 @@
|
||||
|
||||
THIS_FILE
|
||||
|
||||
PUBLIC sr_fd_t sr_fd_table[FD_NR];
|
||||
sr_fd_t sr_fd_table[FD_NR];
|
||||
|
||||
PRIVATE mq_t *repl_queue, *repl_queue_tail;
|
||||
PRIVATE struct vscp_vec s_cp_req[SCPVEC_NR];
|
||||
static mq_t *repl_queue, *repl_queue_tail;
|
||||
static struct vscp_vec s_cp_req[SCPVEC_NR];
|
||||
|
||||
FORWARD int sr_open(message *m);
|
||||
FORWARD void sr_close(message *m);
|
||||
FORWARD int sr_rwio(mq_t *m);
|
||||
FORWARD int sr_restart_read(sr_fd_t *fdp);
|
||||
FORWARD int sr_restart_write(sr_fd_t *fdp);
|
||||
FORWARD int sr_restart_ioctl(sr_fd_t *fdp);
|
||||
FORWARD int sr_cancel(message *m);
|
||||
FORWARD int sr_select(message *m);
|
||||
FORWARD void sr_status(message *m);
|
||||
FORWARD void sr_reply_(mq_t *m, int reply, int is_revive);
|
||||
FORWARD sr_fd_t *sr_getchannel(int minor);
|
||||
FORWARD acc_t *sr_get_userdata(int fd, size_t offset, size_t count, int
|
||||
static int sr_open(message *m);
|
||||
static void sr_close(message *m);
|
||||
static int sr_rwio(mq_t *m);
|
||||
static int sr_restart_read(sr_fd_t *fdp);
|
||||
static int sr_restart_write(sr_fd_t *fdp);
|
||||
static int sr_restart_ioctl(sr_fd_t *fdp);
|
||||
static int sr_cancel(message *m);
|
||||
static int sr_select(message *m);
|
||||
static void sr_status(message *m);
|
||||
static void sr_reply_(mq_t *m, int reply, int is_revive);
|
||||
static sr_fd_t *sr_getchannel(int minor);
|
||||
static acc_t *sr_get_userdata(int fd, size_t offset, size_t count, int
|
||||
for_ioctl);
|
||||
FORWARD int sr_put_userdata(int fd, size_t offset, acc_t *data, int
|
||||
static int sr_put_userdata(int fd, size_t offset, acc_t *data, int
|
||||
for_ioctl);
|
||||
FORWARD void sr_select_res(int fd, unsigned ops);
|
||||
FORWARD int sr_repl_queue(int proc, int ref, int operation);
|
||||
FORWARD int walk_queue(sr_fd_t *sr_fd, mq_t **q_head_ptr, mq_t
|
||||
static void sr_select_res(int fd, unsigned ops);
|
||||
static int sr_repl_queue(int proc, int ref, int operation);
|
||||
static int walk_queue(sr_fd_t *sr_fd, mq_t **q_head_ptr, mq_t
|
||||
**q_tail_ptr, int type, int proc_nr, int ref, int first_flag);
|
||||
FORWARD void sr_event(event_t *evp, ev_arg_t arg);
|
||||
FORWARD int cp_u2b(endpoint_t proc, cp_grant_id_t gid, vir_bytes offset,
|
||||
static void sr_event(event_t *evp, ev_arg_t arg);
|
||||
static int cp_u2b(endpoint_t proc, cp_grant_id_t gid, vir_bytes offset,
|
||||
acc_t **var_acc_ptr, int size);
|
||||
FORWARD int cp_b2u(acc_t *acc_ptr, endpoint_t proc, cp_grant_id_t gid,
|
||||
static int cp_b2u(acc_t *acc_ptr, endpoint_t proc, cp_grant_id_t gid,
|
||||
vir_bytes offset);
|
||||
|
||||
PUBLIC void sr_init()
|
||||
void sr_init()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -114,7 +114,7 @@ PUBLIC void sr_init()
|
||||
repl_queue= NULL;
|
||||
}
|
||||
|
||||
PUBLIC void sr_rec(m)
|
||||
void sr_rec(m)
|
||||
mq_t *m;
|
||||
{
|
||||
int result;
|
||||
@@ -190,7 +190,7 @@ mq_t *m;
|
||||
mq_free(m);
|
||||
}
|
||||
|
||||
PUBLIC void sr_add_minor(minor, port, openf, closef, readf, writef,
|
||||
void sr_add_minor(minor, port, openf, closef, readf, writef,
|
||||
ioctlf, cancelf, selectf)
|
||||
int minor;
|
||||
int port;
|
||||
@@ -221,7 +221,7 @@ sr_select_t selectf;
|
||||
sr_fd->srf_select= selectf;
|
||||
}
|
||||
|
||||
PRIVATE int sr_open(m)
|
||||
static int sr_open(m)
|
||||
message *m;
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
@@ -262,7 +262,7 @@ message *m;
|
||||
return i;
|
||||
}
|
||||
|
||||
PRIVATE void sr_close(m)
|
||||
static void sr_close(m)
|
||||
message *m;
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
@@ -278,7 +278,7 @@ message *m;
|
||||
sr_fd->srf_flags= SFF_FREE;
|
||||
}
|
||||
|
||||
PRIVATE int sr_rwio(m)
|
||||
static int sr_rwio(m)
|
||||
mq_t *m;
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
@@ -375,7 +375,7 @@ mq_t *m;
|
||||
return r;
|
||||
}
|
||||
|
||||
PRIVATE int sr_restart_read(sr_fd)
|
||||
static int sr_restart_read(sr_fd)
|
||||
sr_fd_t *sr_fd;
|
||||
{
|
||||
mq_t *mp;
|
||||
@@ -401,7 +401,7 @@ sr_fd_t *sr_fd;
|
||||
return r;
|
||||
}
|
||||
|
||||
PRIVATE int sr_restart_write(sr_fd)
|
||||
static int sr_restart_write(sr_fd)
|
||||
sr_fd_t *sr_fd;
|
||||
{
|
||||
mq_t *mp;
|
||||
@@ -427,7 +427,7 @@ sr_fd_t *sr_fd;
|
||||
return r;
|
||||
}
|
||||
|
||||
PRIVATE int sr_restart_ioctl(sr_fd)
|
||||
static int sr_restart_ioctl(sr_fd)
|
||||
sr_fd_t *sr_fd;
|
||||
{
|
||||
mq_t *mp;
|
||||
@@ -453,7 +453,7 @@ sr_fd_t *sr_fd;
|
||||
return r;
|
||||
}
|
||||
|
||||
PRIVATE int sr_cancel(m)
|
||||
static int sr_cancel(m)
|
||||
message *m;
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
@@ -492,7 +492,7 @@ message *m;
|
||||
return result;
|
||||
}
|
||||
|
||||
PRIVATE int sr_select(m)
|
||||
static int sr_select(m)
|
||||
message *m;
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
@@ -522,7 +522,7 @@ message *m;
|
||||
return m_ops;
|
||||
}
|
||||
|
||||
PRIVATE void sr_status(m)
|
||||
static void sr_status(m)
|
||||
message *m;
|
||||
{
|
||||
int fd, result;
|
||||
@@ -581,7 +581,7 @@ message *m;
|
||||
ip_panic(("unable to send"));
|
||||
}
|
||||
|
||||
PRIVATE int walk_queue(sr_fd, q_head_ptr, q_tail_ptr, type, proc_nr, ref,
|
||||
static int walk_queue(sr_fd, q_head_ptr, q_tail_ptr, type, proc_nr, ref,
|
||||
first_flag)
|
||||
sr_fd_t *sr_fd;
|
||||
mq_t **q_head_ptr;
|
||||
@@ -626,7 +626,7 @@ int first_flag;
|
||||
return EAGAIN;
|
||||
}
|
||||
|
||||
PRIVATE sr_fd_t *sr_getchannel(minor)
|
||||
static sr_fd_t *sr_getchannel(minor)
|
||||
int minor;
|
||||
{
|
||||
sr_fd_t *loc_fd;
|
||||
@@ -642,7 +642,7 @@ int minor;
|
||||
return loc_fd;
|
||||
}
|
||||
|
||||
PRIVATE void sr_reply_(mq, status, is_revive)
|
||||
static void sr_reply_(mq, status, is_revive)
|
||||
mq_t *mq;
|
||||
int status;
|
||||
int is_revive;
|
||||
@@ -688,7 +688,7 @@ int is_revive;
|
||||
mq_free(mq);
|
||||
}
|
||||
|
||||
PRIVATE acc_t *sr_get_userdata (fd, offset, count, for_ioctl)
|
||||
static acc_t *sr_get_userdata (fd, offset, count, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
size_t count;
|
||||
@@ -750,7 +750,7 @@ int for_ioctl;
|
||||
return result<0 ? NULL : acc;
|
||||
}
|
||||
|
||||
PRIVATE int sr_put_userdata (fd, offset, data, for_ioctl)
|
||||
static int sr_put_userdata (fd, offset, data, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -809,7 +809,7 @@ int for_ioctl;
|
||||
(int)(*head_ptr)->mq_mess.IO_GRANT, offset);
|
||||
}
|
||||
|
||||
PRIVATE void sr_select_res(int fd, unsigned ops)
|
||||
static void sr_select_res(int fd, unsigned ops)
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
|
||||
@@ -822,7 +822,7 @@ PRIVATE void sr_select_res(int fd, unsigned ops)
|
||||
notify(sr_fd->srf_select_proc);
|
||||
}
|
||||
|
||||
PRIVATE void sr_event(evp, arg)
|
||||
static void sr_event(evp, arg)
|
||||
event_t *evp;
|
||||
ev_arg_t arg;
|
||||
{
|
||||
@@ -863,7 +863,7 @@ ev_arg_t arg;
|
||||
ip_panic(("sr_event: unknown event\n"));
|
||||
}
|
||||
|
||||
PRIVATE int cp_u2b(proc, gid, offset, var_acc_ptr, size)
|
||||
static int cp_u2b(proc, gid, offset, var_acc_ptr, size)
|
||||
endpoint_t proc;
|
||||
cp_grant_id_t gid;
|
||||
vir_bytes offset;
|
||||
@@ -926,7 +926,7 @@ int size;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int cp_b2u(acc_ptr, proc, gid, offset)
|
||||
static int cp_b2u(acc_ptr, proc, gid, offset)
|
||||
acc_t *acc_ptr;
|
||||
endpoint_t proc;
|
||||
cp_grant_id_t gid;
|
||||
@@ -989,7 +989,7 @@ vir_bytes offset;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int sr_repl_queue(proc, ref, operation)
|
||||
static int sr_repl_queue(proc, ref, operation)
|
||||
int proc;
|
||||
int ref;
|
||||
int operation;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "inc.h"
|
||||
|
||||
PUBLIC int identifier = 0x1234;
|
||||
PUBLIC endpoint_t who_e;
|
||||
PUBLIC int call_type;
|
||||
PUBLIC endpoint_t SELF_E;
|
||||
int identifier = 0x1234;
|
||||
endpoint_t who_e;
|
||||
int call_type;
|
||||
endpoint_t SELF_E;
|
||||
|
||||
PRIVATE struct {
|
||||
static struct {
|
||||
int type;
|
||||
int (*func)(message *);
|
||||
int reply; /* whether the reply action is passed through */
|
||||
@@ -21,14 +21,14 @@ PRIVATE struct {
|
||||
|
||||
#define SIZE(a) (sizeof(a)/sizeof(a[0]))
|
||||
|
||||
PRIVATE int verbose = 0;
|
||||
static int verbose = 0;
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
FORWARD void sef_cb_signal_handler(int signo);
|
||||
static void sef_local_startup(void);
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
static void sef_cb_signal_handler(int signo);
|
||||
|
||||
PUBLIC int main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
message m;
|
||||
|
||||
@@ -107,7 +107,7 @@ PUBLIC int main(int argc, char *argv[])
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -125,7 +125,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
{
|
||||
/* Initialize the ipc server. */
|
||||
|
||||
@@ -140,7 +140,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
/*===========================================================================*
|
||||
* sef_cb_signal_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_cb_signal_handler(int signo)
|
||||
static void sef_cb_signal_handler(int signo)
|
||||
{
|
||||
/* Only check for termination signal, ignore anything else. */
|
||||
if (signo != SIGTERM) return;
|
||||
|
||||
@@ -25,10 +25,10 @@ struct sem_struct {
|
||||
struct semaphore sems[SEMMSL];
|
||||
};
|
||||
|
||||
PRIVATE struct sem_struct sem_list[SEMMNI];
|
||||
PRIVATE int sem_list_nr = 0;
|
||||
static struct sem_struct sem_list[SEMMNI];
|
||||
static int sem_list_nr = 0;
|
||||
|
||||
PRIVATE struct sem_struct *sem_find_key(key_t key)
|
||||
static struct sem_struct *sem_find_key(key_t key)
|
||||
{
|
||||
int i;
|
||||
if (key == IPC_PRIVATE)
|
||||
@@ -39,7 +39,7 @@ PRIVATE struct sem_struct *sem_find_key(key_t key)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE struct sem_struct *sem_find_id(int id)
|
||||
static struct sem_struct *sem_find_id(int id)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < sem_list_nr; i++)
|
||||
@@ -51,7 +51,7 @@ PRIVATE struct sem_struct *sem_find_id(int id)
|
||||
/*===========================================================================*
|
||||
* do_semget *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_semget(message *m)
|
||||
int do_semget(message *m)
|
||||
{
|
||||
key_t key;
|
||||
int nsems, flag, id;
|
||||
@@ -98,7 +98,7 @@ PUBLIC int do_semget(message *m)
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE void send_message_to_process(endpoint_t who, int ret, int ignore)
|
||||
static void send_message_to_process(endpoint_t who, int ret, int ignore)
|
||||
{
|
||||
message m;
|
||||
|
||||
@@ -106,7 +106,7 @@ PRIVATE void send_message_to_process(endpoint_t who, int ret, int ignore)
|
||||
sendnb(who, &m);
|
||||
}
|
||||
|
||||
PRIVATE void remove_semaphore(struct sem_struct *sem)
|
||||
static void remove_semaphore(struct sem_struct *sem)
|
||||
{
|
||||
int i, nr;
|
||||
|
||||
@@ -129,7 +129,7 @@ PRIVATE void remove_semaphore(struct sem_struct *sem)
|
||||
}
|
||||
|
||||
#if 0
|
||||
PRIVATE void show_semaphore(void)
|
||||
static void show_semaphore(void)
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
@@ -164,7 +164,7 @@ PRIVATE void show_semaphore(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
PRIVATE void remove_process(endpoint_t pt)
|
||||
static void remove_process(endpoint_t pt)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -210,7 +210,7 @@ PRIVATE void remove_process(endpoint_t pt)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void update_one_semaphore(struct sem_struct *sem, int is_remove)
|
||||
static void update_one_semaphore(struct sem_struct *sem, int is_remove)
|
||||
{
|
||||
int i, j, nr;
|
||||
struct semaphore *semaphore;
|
||||
@@ -266,7 +266,7 @@ PRIVATE void update_one_semaphore(struct sem_struct *sem, int is_remove)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void update_semaphores(void)
|
||||
static void update_semaphores(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -277,7 +277,7 @@ PRIVATE void update_semaphores(void)
|
||||
/*===========================================================================*
|
||||
* do_semctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_semctl(message *m)
|
||||
int do_semctl(message *m)
|
||||
{
|
||||
int r, i;
|
||||
long opt;
|
||||
@@ -437,7 +437,7 @@ PUBLIC int do_semctl(message *m)
|
||||
/*===========================================================================*
|
||||
* do_semop *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_semop(message *m)
|
||||
int do_semop(message *m)
|
||||
{
|
||||
int id, i, j, r;
|
||||
struct sembuf *sops;
|
||||
@@ -589,7 +589,7 @@ out:
|
||||
/*===========================================================================*
|
||||
* is_sem_nil *
|
||||
*===========================================================================*/
|
||||
PUBLIC int is_sem_nil(void)
|
||||
int is_sem_nil(void)
|
||||
{
|
||||
return (sem_list_nr == 0);
|
||||
}
|
||||
@@ -597,7 +597,7 @@ PUBLIC int is_sem_nil(void)
|
||||
/*===========================================================================*
|
||||
* sem_process_vm_notify *
|
||||
*===========================================================================*/
|
||||
PUBLIC void sem_process_vm_notify(void)
|
||||
void sem_process_vm_notify(void)
|
||||
{
|
||||
endpoint_t pt;
|
||||
int r;
|
||||
|
||||
@@ -9,10 +9,10 @@ struct shm_struct {
|
||||
vir_bytes page;
|
||||
phys_bytes phys;
|
||||
};
|
||||
PRIVATE struct shm_struct shm_list[MAX_SHM_NR];
|
||||
PRIVATE int shm_list_nr = 0;
|
||||
static struct shm_struct shm_list[MAX_SHM_NR];
|
||||
static int shm_list_nr = 0;
|
||||
|
||||
PRIVATE struct shm_struct *shm_find_key(key_t key)
|
||||
static struct shm_struct *shm_find_key(key_t key)
|
||||
{
|
||||
int i;
|
||||
if (key == IPC_PRIVATE)
|
||||
@@ -23,7 +23,7 @@ PRIVATE struct shm_struct *shm_find_key(key_t key)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE struct shm_struct *shm_find_id(int id)
|
||||
static struct shm_struct *shm_find_id(int id)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < shm_list_nr; i++)
|
||||
@@ -35,7 +35,7 @@ PRIVATE struct shm_struct *shm_find_id(int id)
|
||||
/*===========================================================================*
|
||||
* do_shmget *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_shmget(message *m)
|
||||
int do_shmget(message *m)
|
||||
{
|
||||
struct shm_struct *shm;
|
||||
long key, size, old_size;
|
||||
@@ -106,7 +106,7 @@ PUBLIC int do_shmget(message *m)
|
||||
/*===========================================================================*
|
||||
* do_shmat *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_shmat(message *m)
|
||||
int do_shmat(message *m)
|
||||
{
|
||||
int id, flag;
|
||||
vir_bytes addr;
|
||||
@@ -150,7 +150,7 @@ PUBLIC int do_shmat(message *m)
|
||||
/*===========================================================================*
|
||||
* update_refcount_and_destroy *
|
||||
*===========================================================================*/
|
||||
PUBLIC void update_refcount_and_destroy(void)
|
||||
void update_refcount_and_destroy(void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@@ -182,7 +182,7 @@ PUBLIC void update_refcount_and_destroy(void)
|
||||
/*===========================================================================*
|
||||
* do_shmdt *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_shmdt(message *m)
|
||||
int do_shmdt(message *m)
|
||||
{
|
||||
vir_bytes addr;
|
||||
phys_bytes paddr;
|
||||
@@ -216,7 +216,7 @@ PUBLIC int do_shmdt(message *m)
|
||||
/*===========================================================================*
|
||||
* do_shmctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_shmctl(message *m)
|
||||
int do_shmctl(message *m)
|
||||
{
|
||||
int id = m->SHMCTL_ID;
|
||||
int cmd = m->SHMCTL_CMD;
|
||||
@@ -328,7 +328,7 @@ PUBLIC int do_shmctl(message *m)
|
||||
}
|
||||
|
||||
#if 0
|
||||
PRIVATE void list_shm_ds(void)
|
||||
static void list_shm_ds(void)
|
||||
{
|
||||
int i;
|
||||
printf("key\tid\tpage\n");
|
||||
@@ -343,7 +343,7 @@ PRIVATE void list_shm_ds(void)
|
||||
/*===========================================================================*
|
||||
* is_shm_nil *
|
||||
*===========================================================================*/
|
||||
PUBLIC int is_shm_nil(void)
|
||||
int is_shm_nil(void)
|
||||
{
|
||||
return (shm_list_nr == 0);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "inc.h"
|
||||
|
||||
PUBLIC int check_perm(struct ipc_perm *req, endpoint_t who, int mode)
|
||||
int check_perm(struct ipc_perm *req, endpoint_t who, int mode)
|
||||
{
|
||||
int req_mode;
|
||||
int cur_mode;
|
||||
|
||||
@@ -43,7 +43,7 @@ struct hook_entry {
|
||||
/*===========================================================================*
|
||||
* map_unmap_keys *
|
||||
*===========================================================================*/
|
||||
PUBLIC void map_unmap_fkeys(map)
|
||||
void map_unmap_fkeys(map)
|
||||
int map;
|
||||
{
|
||||
int fkeys, sfkeys;
|
||||
@@ -70,7 +70,7 @@ int map;
|
||||
*===========================================================================*/
|
||||
#define pressed(k) ((F1<=(k)&&(k)<=F12 && bit_isset(m->FKEY_FKEYS,((k)-F1+1)))\
|
||||
|| (SF1<=(k) && (k)<=SF12 && bit_isset(m->FKEY_SFKEYS, ((k)-SF1+1))))
|
||||
PUBLIC int do_fkey_pressed(m)
|
||||
int do_fkey_pressed(m)
|
||||
message *m; /* notification message */
|
||||
{
|
||||
int s, h;
|
||||
@@ -95,7 +95,7 @@ message *m; /* notification message */
|
||||
/*===========================================================================*
|
||||
* key_name *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *key_name(int key)
|
||||
static char *key_name(int key)
|
||||
{
|
||||
static char name[15];
|
||||
|
||||
@@ -112,7 +112,7 @@ PRIVATE char *key_name(int key)
|
||||
/*===========================================================================*
|
||||
* mapping_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void mapping_dmp(void)
|
||||
void mapping_dmp(void)
|
||||
{
|
||||
int h;
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#define LINES 22
|
||||
|
||||
PRIVATE struct data_store ds_store[NR_DS_KEYS];
|
||||
static struct data_store ds_store[NR_DS_KEYS];
|
||||
|
||||
PUBLIC void data_store_dmp()
|
||||
void data_store_dmp()
|
||||
{
|
||||
struct data_store *p;
|
||||
static int prev_i = 0;
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
#include "../vfs/dmap.h"
|
||||
#include <minix/dmap.h>
|
||||
|
||||
PUBLIC struct fproc fproc[NR_PROCS];
|
||||
PUBLIC struct dmap dmap[NR_DEVICES];
|
||||
struct fproc fproc[NR_PROCS];
|
||||
struct dmap dmap[NR_DEVICES];
|
||||
|
||||
/*===========================================================================*
|
||||
* fproc_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void fproc_dmp()
|
||||
void fproc_dmp()
|
||||
{
|
||||
struct fproc *fp;
|
||||
int i, n=0;
|
||||
@@ -59,7 +59,7 @@ PUBLIC void fproc_dmp()
|
||||
/*===========================================================================*
|
||||
* dmap_flags *
|
||||
*===========================================================================*/
|
||||
PRIVATE char * dmap_flags(int flags)
|
||||
static char * dmap_flags(int flags)
|
||||
{
|
||||
static char fl[10];
|
||||
strcpy(fl, "-----");
|
||||
@@ -70,7 +70,7 @@ PRIVATE char * dmap_flags(int flags)
|
||||
/*===========================================================================*
|
||||
* dmap_style *
|
||||
*===========================================================================*/
|
||||
PRIVATE char * dmap_style(int dev_style)
|
||||
static char * dmap_style(int dev_style)
|
||||
{
|
||||
static char str[16];
|
||||
switch(dev_style) {
|
||||
@@ -89,7 +89,7 @@ PRIVATE char * dmap_style(int dev_style)
|
||||
/*===========================================================================*
|
||||
* dtab_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void dtab_dmp()
|
||||
void dtab_dmp()
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -41,24 +41,24 @@ static int pagelines;
|
||||
((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
|
||||
|
||||
/* Declare some local dump procedures. */
|
||||
FORWARD char *proc_name(int proc_nr);
|
||||
FORWARD char *s_traps_str(int flags);
|
||||
FORWARD char *s_flags_str(int flags);
|
||||
FORWARD char *p_rts_flags_str(int flags);
|
||||
FORWARD char *boot_flags_str(int flags);
|
||||
static char *proc_name(int proc_nr);
|
||||
static char *s_traps_str(int flags);
|
||||
static char *s_flags_str(int flags);
|
||||
static char *p_rts_flags_str(int flags);
|
||||
static char *boot_flags_str(int flags);
|
||||
|
||||
/* Some global data that is shared among several dumping procedures.
|
||||
* Note that the process table copy has the same name as in the kernel
|
||||
* so that most macros and definitions from proc.h also apply here.
|
||||
*/
|
||||
PUBLIC struct proc proc[NR_TASKS + NR_PROCS];
|
||||
PUBLIC struct priv priv[NR_SYS_PROCS];
|
||||
PUBLIC struct boot_image image[NR_BOOT_PROCS];
|
||||
struct proc proc[NR_TASKS + NR_PROCS];
|
||||
struct priv priv[NR_SYS_PROCS];
|
||||
struct boot_image image[NR_BOOT_PROCS];
|
||||
|
||||
/*===========================================================================*
|
||||
* kmessages_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void kmessages_dmp()
|
||||
void kmessages_dmp()
|
||||
{
|
||||
struct kmessages kmess; /* get copy of kernel messages */
|
||||
char print_buf[_KMESS_BUF_SIZE+1]; /* this one is used to print */
|
||||
@@ -90,7 +90,7 @@ PUBLIC void kmessages_dmp()
|
||||
/*===========================================================================*
|
||||
* monparams_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void monparams_dmp()
|
||||
void monparams_dmp()
|
||||
{
|
||||
char val[1024];
|
||||
char *e;
|
||||
@@ -117,7 +117,7 @@ PUBLIC void monparams_dmp()
|
||||
/*===========================================================================*
|
||||
* irqtab_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void irqtab_dmp()
|
||||
void irqtab_dmp()
|
||||
{
|
||||
int i,r;
|
||||
struct irq_hook irq_hooks[NR_IRQ_HOOKS];
|
||||
@@ -163,7 +163,7 @@ PUBLIC void irqtab_dmp()
|
||||
/*===========================================================================*
|
||||
* boot_flags_str *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *boot_flags_str(int flags)
|
||||
static char *boot_flags_str(int flags)
|
||||
{
|
||||
static char str[10];
|
||||
str[0] = (flags & PROC_FULLVM) ? 'V' : '-';
|
||||
@@ -175,7 +175,7 @@ PRIVATE char *boot_flags_str(int flags)
|
||||
/*===========================================================================*
|
||||
* image_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void image_dmp()
|
||||
void image_dmp()
|
||||
{
|
||||
int m, r;
|
||||
struct boot_image *ip;
|
||||
@@ -199,7 +199,7 @@ PUBLIC void image_dmp()
|
||||
/*===========================================================================*
|
||||
* kenv_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void kenv_dmp()
|
||||
void kenv_dmp()
|
||||
{
|
||||
struct kinfo kinfo;
|
||||
struct machine machine;
|
||||
@@ -234,7 +234,7 @@ PUBLIC void kenv_dmp()
|
||||
/*===========================================================================*
|
||||
* s_flags_str *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *s_flags_str(int flags)
|
||||
static char *s_flags_str(int flags)
|
||||
{
|
||||
static char str[10];
|
||||
str[0] = (flags & PREEMPTIBLE) ? 'P' : '-';
|
||||
@@ -252,7 +252,7 @@ PRIVATE char *s_flags_str(int flags)
|
||||
/*===========================================================================*
|
||||
* s_traps_str *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *s_traps_str(int flags)
|
||||
static char *s_traps_str(int flags)
|
||||
{
|
||||
static char str[10];
|
||||
str[0] = (flags & (1 << SEND)) ? 'S' : '-';
|
||||
@@ -268,7 +268,7 @@ PRIVATE char *s_traps_str(int flags)
|
||||
/*===========================================================================*
|
||||
* privileges_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void privileges_dmp()
|
||||
void privileges_dmp()
|
||||
{
|
||||
register struct proc *rp;
|
||||
static struct proc *oldrp = BEG_PROC_ADDR;
|
||||
@@ -315,7 +315,7 @@ PUBLIC void privileges_dmp()
|
||||
/*===========================================================================*
|
||||
* p_rts_flags_str *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *p_rts_flags_str(int flags)
|
||||
static char *p_rts_flags_str(int flags)
|
||||
{
|
||||
static char str[10];
|
||||
str[0] = (flags & RTS_PROC_STOP) ? 's' : '-';
|
||||
@@ -334,7 +334,7 @@ PRIVATE char *p_rts_flags_str(int flags)
|
||||
* proctab_dmp *
|
||||
*===========================================================================*/
|
||||
#if (CHIP == INTEL)
|
||||
PUBLIC void proctab_dmp()
|
||||
void proctab_dmp()
|
||||
{
|
||||
/* Proc table dump */
|
||||
|
||||
@@ -371,7 +371,7 @@ PUBLIC void proctab_dmp()
|
||||
/*===========================================================================*
|
||||
* procstack_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void procstack_dmp()
|
||||
void procstack_dmp()
|
||||
{
|
||||
/* Proc table dump, with stack */
|
||||
|
||||
@@ -396,7 +396,7 @@ PUBLIC void procstack_dmp()
|
||||
/*===========================================================================*
|
||||
* memmap_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void memmap_dmp()
|
||||
void memmap_dmp()
|
||||
{
|
||||
register struct proc *rp;
|
||||
static struct proc *oldrp = proc;
|
||||
@@ -428,7 +428,7 @@ PUBLIC void memmap_dmp()
|
||||
/*===========================================================================*
|
||||
* proc_name *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *proc_name(proc_nr)
|
||||
static char *proc_name(proc_nr)
|
||||
int proc_nr;
|
||||
{
|
||||
struct proc *p;
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
#include <minix/config.h>
|
||||
#include <minix/type.h>
|
||||
|
||||
PUBLIC struct mproc mproc[NR_PROCS];
|
||||
struct mproc mproc[NR_PROCS];
|
||||
|
||||
/*===========================================================================*
|
||||
* mproc_dmp *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *flags_str(int flags)
|
||||
static char *flags_str(int flags)
|
||||
{
|
||||
static char str[14];
|
||||
str[0] = (flags & WAITING) ? 'W' : '-';
|
||||
@@ -39,7 +39,7 @@ PRIVATE char *flags_str(int flags)
|
||||
return str;
|
||||
}
|
||||
|
||||
PUBLIC void mproc_dmp()
|
||||
void mproc_dmp()
|
||||
{
|
||||
struct mproc *mp;
|
||||
int i, n=0;
|
||||
@@ -72,7 +72,7 @@ PUBLIC void mproc_dmp()
|
||||
/*===========================================================================*
|
||||
* sigaction_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void sigaction_dmp()
|
||||
void sigaction_dmp()
|
||||
{
|
||||
struct mproc *mp;
|
||||
int i, n=0;
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
#include "../rs/const.h"
|
||||
#include "../rs/type.h"
|
||||
|
||||
PUBLIC struct rprocpub rprocpub[NR_SYS_PROCS];
|
||||
PUBLIC struct rproc rproc[NR_SYS_PROCS];
|
||||
struct rprocpub rprocpub[NR_SYS_PROCS];
|
||||
struct rproc rproc[NR_SYS_PROCS];
|
||||
|
||||
FORWARD char *s_flags_str(int flags, int sys_flags);
|
||||
static char *s_flags_str(int flags, int sys_flags);
|
||||
|
||||
/*===========================================================================*
|
||||
* rproc_dmp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void rproc_dmp()
|
||||
void rproc_dmp()
|
||||
{
|
||||
struct rproc *rp;
|
||||
struct rprocpub *rpub;
|
||||
@@ -56,7 +56,7 @@ PUBLIC void rproc_dmp()
|
||||
}
|
||||
|
||||
|
||||
PRIVATE char *s_flags_str(int flags, int sys_flags)
|
||||
static char *s_flags_str(int flags, int sys_flags)
|
||||
{
|
||||
static char str[10];
|
||||
str[0] = (flags & RS_ACTIVE) ? 'A' : '-';
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#define LINES 24
|
||||
|
||||
PRIVATE void print_region(struct vm_region_info *vri, int *n)
|
||||
static void print_region(struct vm_region_info *vri, int *n)
|
||||
{
|
||||
static int vri_count, vri_prev_set;
|
||||
static struct vm_region_info vri_prev;
|
||||
@@ -61,7 +61,7 @@ PRIVATE void print_region(struct vm_region_info *vri, int *n)
|
||||
(*n)++;
|
||||
}
|
||||
|
||||
PUBLIC void vm_dmp()
|
||||
void vm_dmp()
|
||||
{
|
||||
static struct proc proc[NR_TASKS + NR_PROCS];
|
||||
static struct vm_region_info vri[LINES];
|
||||
|
||||
@@ -11,26 +11,26 @@
|
||||
#include <minix/endpoint.h>
|
||||
|
||||
/* Allocate space for the global variables. */
|
||||
PRIVATE message m_in; /* the input message itself */
|
||||
PRIVATE message m_out; /* the output message used for reply */
|
||||
PRIVATE endpoint_t who_e; /* caller's proc number */
|
||||
PRIVATE int callnr; /* system call number */
|
||||
static message m_in; /* the input message itself */
|
||||
static message m_out; /* the output message used for reply */
|
||||
static endpoint_t who_e; /* caller's proc number */
|
||||
static int callnr; /* system call number */
|
||||
|
||||
extern int errno; /* error number set by system library */
|
||||
|
||||
/* Declare some local functions. */
|
||||
FORWARD void get_work(void);
|
||||
FORWARD void reply(int whom, int result);
|
||||
static void get_work(void);
|
||||
static void reply(int whom, int result);
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
FORWARD void sef_cb_signal_handler(int signo);
|
||||
static void sef_local_startup(void);
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
static void sef_cb_signal_handler(int signo);
|
||||
|
||||
/*===========================================================================*
|
||||
* main *
|
||||
*===========================================================================*/
|
||||
PUBLIC int main(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
/* This is the main routine of this service. The main loop consists of
|
||||
* three major activities: getting new work, processing the work, and
|
||||
@@ -75,7 +75,7 @@ PUBLIC int main(int argc, char **argv)
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -96,7 +96,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
{
|
||||
/* Initialize the information server. */
|
||||
|
||||
@@ -109,7 +109,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
/*===========================================================================*
|
||||
* sef_cb_signal_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_cb_signal_handler(int signo)
|
||||
static void sef_cb_signal_handler(int signo)
|
||||
{
|
||||
/* Only check for termination signal, ignore anything else. */
|
||||
if (signo != SIGTERM) return;
|
||||
@@ -123,7 +123,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
|
||||
/*===========================================================================*
|
||||
* get_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void get_work()
|
||||
static void get_work()
|
||||
{
|
||||
int status = 0;
|
||||
status = sef_receive(ANY, &m_in); /* this blocks until message arrives */
|
||||
@@ -136,7 +136,7 @@ PRIVATE void get_work()
|
||||
/*===========================================================================*
|
||||
* reply *
|
||||
*===========================================================================*/
|
||||
PRIVATE void reply(who, result)
|
||||
static void reply(who, result)
|
||||
int who; /* destination */
|
||||
int result; /* report result to replyee */
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <dirent.h>
|
||||
|
||||
PUBLIC struct buf {
|
||||
struct buf {
|
||||
char b_data[_MAX_BLOCK_SIZE]; /* ordinary user data */
|
||||
block_t b_blocknr; /* block number of its (minor) device */
|
||||
char b_count; /* number of users of this buffer */
|
||||
|
||||
@@ -17,16 +17,16 @@
|
||||
#include <minix/bdev.h>
|
||||
#include "buf.h"
|
||||
|
||||
FORWARD int read_block(struct buf *);
|
||||
static int read_block(struct buf *);
|
||||
|
||||
PUBLIC struct buf *bp_to_pickup = buf; /* This is a pointer to the next node in the
|
||||
struct buf *bp_to_pickup = buf; /* This is a pointer to the next node in the
|
||||
* buffer cache to pick up*/
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* get_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct buf *get_block(block)
|
||||
struct buf *get_block(block)
|
||||
register block_t block; /* which block is wanted? */
|
||||
{
|
||||
register struct buf *bp, *free_bp;
|
||||
@@ -76,7 +76,7 @@ register block_t block; /* which block is wanted? */
|
||||
/*===========================================================================*
|
||||
* put_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC void put_block(bp)
|
||||
void put_block(bp)
|
||||
register struct buf *bp; /* pointer to the buffer to be released */
|
||||
{
|
||||
if (bp == NULL) return; /* it is easier to check here than in caller */
|
||||
@@ -87,7 +87,7 @@ register struct buf *bp; /* pointer to the buffer to be released */
|
||||
/*===========================================================================*
|
||||
* read_block *
|
||||
*===========================================================================*/
|
||||
PRIVATE int read_block(bp)
|
||||
static int read_block(bp)
|
||||
register struct buf *bp; /* buffer pointer */
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_putnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_putnode()
|
||||
int fs_putnode()
|
||||
{
|
||||
/* Find the inode specified by the request message and decrease its counter. */
|
||||
int count;
|
||||
@@ -40,7 +40,7 @@ PUBLIC int fs_putnode()
|
||||
/*===========================================================================*
|
||||
* release_dir_record *
|
||||
*===========================================================================*/
|
||||
PUBLIC int release_dir_record(dir)
|
||||
int release_dir_record(dir)
|
||||
struct dir_record *dir;
|
||||
{
|
||||
/* Release a dir record (decrement the counter) */
|
||||
@@ -65,7 +65,7 @@ struct dir_record *dir;
|
||||
/*===========================================================================*
|
||||
* get_free_dir_record *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct dir_record *get_free_dir_record(void)
|
||||
struct dir_record *get_free_dir_record(void)
|
||||
{
|
||||
/* Get a free dir record */
|
||||
struct dir_record *dir;
|
||||
@@ -85,7 +85,7 @@ PUBLIC struct dir_record *get_free_dir_record(void)
|
||||
/*===========================================================================*
|
||||
* get_dir_record *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct dir_record *get_dir_record(id_dir_record)
|
||||
struct dir_record *get_dir_record(id_dir_record)
|
||||
ino_t id_dir_record;
|
||||
{
|
||||
struct dir_record *dir = NULL;
|
||||
@@ -115,7 +115,7 @@ ino_t id_dir_record;
|
||||
/*===========================================================================*
|
||||
* get_free_ext_attr *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct ext_attr_rec *get_free_ext_attr(void) {
|
||||
struct ext_attr_rec *get_free_ext_attr(void) {
|
||||
/* Get a free extended attribute structure */
|
||||
struct ext_attr_rec *dir;
|
||||
for(dir = ext_attr_recs; dir < &ext_attr_recs[NR_ATTR_RECS]; dir++) {
|
||||
@@ -132,7 +132,7 @@ PUBLIC struct ext_attr_rec *get_free_ext_attr(void) {
|
||||
/*===========================================================================*
|
||||
* create_ext_attr *
|
||||
*===========================================================================*/
|
||||
PUBLIC int create_ext_attr(struct ext_attr_rec *ext,char *buffer)
|
||||
int create_ext_attr(struct ext_attr_rec *ext,char *buffer)
|
||||
{
|
||||
/* Fill an extent structure from the data read on the device */
|
||||
if (ext == NULL) return(EINVAL);
|
||||
@@ -161,7 +161,7 @@ PUBLIC int create_ext_attr(struct ext_attr_rec *ext,char *buffer)
|
||||
/*===========================================================================*
|
||||
* create_ext_attr *
|
||||
*===========================================================================*/
|
||||
PUBLIC int create_dir_record(dir,buffer,address)
|
||||
int create_dir_record(dir,buffer,address)
|
||||
struct dir_record *dir;
|
||||
char *buffer;
|
||||
u32_t address;
|
||||
@@ -218,7 +218,7 @@ u32_t address;
|
||||
/*===========================================================================*
|
||||
* load_dir_record_from_disk *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct dir_record *load_dir_record_from_disk(address)
|
||||
struct dir_record *load_dir_record_from_disk(address)
|
||||
u32_t address;
|
||||
{
|
||||
/* This function load a particular dir record from a specific address
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "const.h"
|
||||
|
||||
PUBLIC struct dir_record {
|
||||
struct dir_record {
|
||||
u8_t length; /* The length of the record */
|
||||
u8_t ext_attr_rec_length;
|
||||
u32_t loc_extent_l; /* The same data (in this case loc_extent)is */
|
||||
@@ -30,7 +30,7 @@ PUBLIC struct dir_record {
|
||||
|
||||
} dir_records[NR_DIR_RECORDS];
|
||||
|
||||
PUBLIC struct ext_attr_rec {
|
||||
struct ext_attr_rec {
|
||||
u32_t own_id;
|
||||
u32_t group_id;
|
||||
u16_t permissions;
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
#include "glo.h"
|
||||
|
||||
/* Declare some local functions. */
|
||||
FORWARD void get_work(message *m_in);
|
||||
static void get_work(message *m_in);
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
FORWARD void sef_cb_signal_handler(int signo);
|
||||
static void sef_local_startup(void);
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
static void sef_cb_signal_handler(int signo);
|
||||
|
||||
/*===========================================================================*
|
||||
* main *
|
||||
*===========================================================================*/
|
||||
PUBLIC int main(void) {
|
||||
int main(void) {
|
||||
endpoint_t who_e;
|
||||
int ind, error, transid;
|
||||
|
||||
@@ -78,7 +78,7 @@ PUBLIC int main(void) {
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -96,7 +96,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
{
|
||||
/* Initialize the iso9660fs server. */
|
||||
|
||||
@@ -111,7 +111,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
/*===========================================================================*
|
||||
* sef_cb_signal_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_cb_signal_handler(int signo)
|
||||
static void sef_cb_signal_handler(int signo)
|
||||
{
|
||||
/* Only check for termination signal, ignore anything else. */
|
||||
if (signo != SIGTERM) return;
|
||||
@@ -127,7 +127,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
|
||||
/*===========================================================================*
|
||||
* get_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void get_work(m_in)
|
||||
static void get_work(m_in)
|
||||
message *m_in; /* pointer to message */
|
||||
{
|
||||
int s; /* receive status */
|
||||
@@ -138,7 +138,7 @@ message *m_in; /* pointer to message */
|
||||
/*===========================================================================*
|
||||
* reply *
|
||||
*===========================================================================*/
|
||||
PUBLIC void reply(who, m_out)
|
||||
void reply(who, m_out)
|
||||
int who;
|
||||
message *m_out; /* report result */
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_sync *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_sync()
|
||||
int fs_sync()
|
||||
{
|
||||
/* Always mounted read only, so nothing to sync */
|
||||
return(OK); /* sync() can't fail */
|
||||
@@ -17,7 +17,7 @@ PUBLIC int fs_sync()
|
||||
/*===========================================================================*
|
||||
* fs_new_driver *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_new_driver(void)
|
||||
int fs_new_driver(void)
|
||||
{
|
||||
/* Set a new driver endpoint for this device. */
|
||||
dev_t dev;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_readsuper *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_readsuper() {
|
||||
int fs_readsuper() {
|
||||
|
||||
cp_grant_id_t label_gid;
|
||||
size_t label_len;
|
||||
@@ -61,7 +61,7 @@ PUBLIC int fs_readsuper() {
|
||||
/*===========================================================================*
|
||||
* fs_mountpoint *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_mountpoint()
|
||||
int fs_mountpoint()
|
||||
{
|
||||
/* This function looks up the mount point, it checks the condition whether
|
||||
* the partition can be mounted on the inode or not.
|
||||
@@ -93,7 +93,7 @@ PUBLIC int fs_mountpoint()
|
||||
/*===========================================================================*
|
||||
* fs_unmount *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_unmount(void) {
|
||||
int fs_unmount(void) {
|
||||
release_v_pri(&v_pri); /* Release the super block */
|
||||
bdev_close(fs_dev);
|
||||
unmountdone = TRUE;
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
|
||||
#include "buf.h"
|
||||
|
||||
FORWARD char *get_name(char *name, char string[NAME_MAX+1]);
|
||||
FORWARD int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct
|
||||
static char *get_name(char *name, char string[NAME_MAX+1]);
|
||||
static int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct
|
||||
dir_record **res_inop, size_t *offsetp);
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_lookup *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_lookup() {
|
||||
int fs_lookup() {
|
||||
cp_grant_id_t grant;
|
||||
int r, len, flags;
|
||||
size_t offset;
|
||||
@@ -80,7 +80,7 @@ PUBLIC int fs_lookup() {
|
||||
/*===========================================================================*
|
||||
* search_dir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int search_dir(ldir_ptr,string,numb)
|
||||
int search_dir(ldir_ptr,string,numb)
|
||||
register struct dir_record *ldir_ptr; /* dir record parent */
|
||||
char string[NAME_MAX]; /* component to search for */
|
||||
ino_t *numb; /* pointer to new dir record */
|
||||
@@ -182,7 +182,7 @@ PUBLIC int search_dir(ldir_ptr,string,numb)
|
||||
/*===========================================================================*
|
||||
* parse_path *
|
||||
*===========================================================================*/
|
||||
PRIVATE int parse_path(dir_ino, root_ino, flags, res_inop, offsetp)
|
||||
static int parse_path(dir_ino, root_ino, flags, res_inop, offsetp)
|
||||
ino_t dir_ino;
|
||||
ino_t root_ino;
|
||||
int flags;
|
||||
@@ -281,7 +281,7 @@ size_t *offsetp;
|
||||
/*===========================================================================*
|
||||
* advance *
|
||||
*===========================================================================*/
|
||||
PUBLIC int advance(dirp, string, resp)
|
||||
int advance(dirp, string, resp)
|
||||
struct dir_record *dirp; /* inode for directory to be searched */
|
||||
char string[NAME_MAX]; /* component name to look for */
|
||||
struct dir_record **resp; /* resulting inode */
|
||||
@@ -323,7 +323,7 @@ struct dir_record **resp; /* resulting inode */
|
||||
/*===========================================================================*
|
||||
* get_name *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *get_name(path_name, string)
|
||||
static char *get_name(path_name, string)
|
||||
char *path_name; /* path name to parse */
|
||||
char string[NAME_MAX+1]; /* component extracted from 'old_name' */
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_access *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_access()
|
||||
int fs_access()
|
||||
{
|
||||
struct dir_record *rip;
|
||||
int r = OK;
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
#endif
|
||||
#include "buf.h"
|
||||
|
||||
PRIVATE char getdents_buf[GETDENTS_BUFSIZ];
|
||||
static char getdents_buf[GETDENTS_BUFSIZ];
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_read *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_read(void) {
|
||||
int fs_read(void) {
|
||||
int r, chunk, block_size;
|
||||
int nrbytes;
|
||||
cp_grant_id_t gid;
|
||||
@@ -76,7 +76,7 @@ PUBLIC int fs_read(void) {
|
||||
/*===========================================================================*
|
||||
* fs_bread *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_bread(void)
|
||||
int fs_bread(void)
|
||||
{
|
||||
int r, rw_flag, chunk, block_size;
|
||||
cp_grant_id_t gid;
|
||||
@@ -134,7 +134,7 @@ PUBLIC int fs_bread(void)
|
||||
/*===========================================================================*
|
||||
* fs_getdents *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_getdents(void) {
|
||||
int fs_getdents(void) {
|
||||
struct dir_record *dir;
|
||||
ino_t ino;
|
||||
cp_grant_id_t gid;
|
||||
@@ -280,7 +280,7 @@ PUBLIC int fs_getdents(void) {
|
||||
/*===========================================================================*
|
||||
* read_chunk *
|
||||
*===========================================================================*/
|
||||
PUBLIC int read_chunk(dir, position, off, chunk, left, gid, buf_off, block_size, completed)
|
||||
int read_chunk(dir, position, off, chunk, left, gid, buf_off, block_size, completed)
|
||||
register struct dir_record *dir;/* pointer to inode for file to be rd/wr */
|
||||
u64_t position; /* position within file to read or write */
|
||||
unsigned off; /* off within the current block */
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/*===========================================================================*
|
||||
* stat_dir_record *
|
||||
*===========================================================================*/
|
||||
PRIVATE int stat_dir_record(
|
||||
static int stat_dir_record(
|
||||
register struct dir_record *dir, /* pointer to dir record to stat */
|
||||
int pipe_pos, /* position in a pipe, supplied by fstat() */
|
||||
endpoint_t who_e, /* Caller endpoint */
|
||||
@@ -78,7 +78,7 @@ PRIVATE int stat_dir_record(
|
||||
/*===========================================================================*
|
||||
* fs_stat *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_stat()
|
||||
int fs_stat()
|
||||
{
|
||||
register int r; /* return value */
|
||||
struct dir_record *dir;
|
||||
@@ -96,7 +96,7 @@ PUBLIC int fs_stat()
|
||||
/*===========================================================================*
|
||||
* fs_fstatfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_fstatfs()
|
||||
int fs_fstatfs()
|
||||
{
|
||||
struct statfs st;
|
||||
int r;
|
||||
@@ -114,7 +114,7 @@ PUBLIC int fs_fstatfs()
|
||||
/*===========================================================================*
|
||||
* fs_statvfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_statvfs()
|
||||
int fs_statvfs()
|
||||
{
|
||||
struct statvfs st;
|
||||
int r;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
/* This function is called when the filesystem is umounted. It releases the
|
||||
* super block. */
|
||||
PUBLIC int release_v_pri(v_pri)
|
||||
int release_v_pri(v_pri)
|
||||
register struct iso9660_vd_pri *v_pri;
|
||||
{
|
||||
/* Release the root dir record */
|
||||
@@ -21,7 +21,7 @@ PUBLIC int release_v_pri(v_pri)
|
||||
/* This function fullfill the super block data structure using the information
|
||||
* contained in the stream buf. Such stream is physically read from the device
|
||||
* . */
|
||||
PUBLIC int create_v_pri(v_pri,buf,address)
|
||||
int create_v_pri(v_pri,buf,address)
|
||||
register struct iso9660_vd_pri *v_pri;
|
||||
register char* buf;
|
||||
register unsigned long address;
|
||||
@@ -80,7 +80,7 @@ PUBLIC int create_v_pri(v_pri,buf,address)
|
||||
|
||||
/* This function reads from a ISO9660 filesystem (in the device dev) the
|
||||
* super block and saves it in v_pri. */
|
||||
PUBLIC int read_vds(
|
||||
int read_vds(
|
||||
register struct iso9660_vd_pri *v_pri,
|
||||
register dev_t dev
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define ROOT_INO_NR 1
|
||||
|
||||
/* Structure for the primary volume descriptor */
|
||||
PUBLIC struct iso9660_vd_pri {
|
||||
struct iso9660_vd_pri {
|
||||
u8_t vd_type;
|
||||
char standard_id[ISO9660_SIZE_STANDARD_ID];
|
||||
u8_t vd_version;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "inc.h"
|
||||
|
||||
PUBLIC int (*fs_call_vec[])(void) = {
|
||||
int (*fs_call_vec[])(void) = {
|
||||
no_sys, /* 0: not used */
|
||||
no_sys, /* 1: not used */
|
||||
fs_putnode, /* 2 */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/*===========================================================================*
|
||||
* do_noop *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_noop(void)
|
||||
int do_noop(void)
|
||||
{
|
||||
/* Do not do anything. */
|
||||
return(OK);
|
||||
@@ -17,7 +17,7 @@ PUBLIC int do_noop(void)
|
||||
/*===========================================================================*
|
||||
* no_sys *
|
||||
*===========================================================================*/
|
||||
PUBLIC int no_sys(void)
|
||||
int no_sys(void)
|
||||
{
|
||||
/* Somebody has used an illegal system call number */
|
||||
return(EINVAL);
|
||||
|
||||
@@ -26,17 +26,17 @@
|
||||
#include "super.h"
|
||||
#include "inode.h"
|
||||
|
||||
FORWARD void rm_lru(struct buf *bp);
|
||||
FORWARD void read_block(struct buf *);
|
||||
static void rm_lru(struct buf *bp);
|
||||
static void read_block(struct buf *);
|
||||
|
||||
PRIVATE int vmcache = 0; /* are we using vm's secondary cache? (initially not) */
|
||||
static int vmcache = 0; /* are we using vm's secondary cache? (initially not) */
|
||||
|
||||
PRIVATE block_t super_start = 0, super_end = 0;
|
||||
static block_t super_start = 0, super_end = 0;
|
||||
|
||||
/*===========================================================================*
|
||||
* get_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct buf *get_block(
|
||||
struct buf *get_block(
|
||||
register dev_t dev, /* on which device is the block? */
|
||||
register block_t block, /* which block is wanted? */
|
||||
int only_search /* if NO_READ, don't read, else act normal */
|
||||
@@ -206,7 +206,7 @@ PUBLIC struct buf *get_block(
|
||||
/*===========================================================================*
|
||||
* put_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC void put_block(bp, block_type)
|
||||
void put_block(bp, block_type)
|
||||
register struct buf *bp; /* pointer to the buffer to be released */
|
||||
int block_type; /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */
|
||||
{
|
||||
@@ -259,7 +259,7 @@ int block_type; /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */
|
||||
/*===========================================================================*
|
||||
* alloc_zone *
|
||||
*===========================================================================*/
|
||||
PUBLIC zone_t alloc_zone(
|
||||
zone_t alloc_zone(
|
||||
dev_t dev, /* device where zone wanted */
|
||||
zone_t z /* try to allocate new zone near this one */
|
||||
)
|
||||
@@ -302,7 +302,7 @@ PUBLIC zone_t alloc_zone(
|
||||
/*===========================================================================*
|
||||
* free_zone *
|
||||
*===========================================================================*/
|
||||
PUBLIC void free_zone(
|
||||
void free_zone(
|
||||
dev_t dev, /* device where zone located */
|
||||
zone_t numb /* zone to be returned */
|
||||
)
|
||||
@@ -323,7 +323,7 @@ PUBLIC void free_zone(
|
||||
/*===========================================================================*
|
||||
* read_block *
|
||||
*===========================================================================*/
|
||||
PRIVATE void read_block(bp)
|
||||
static void read_block(bp)
|
||||
register struct buf *bp; /* buffer pointer */
|
||||
{
|
||||
/* Read or write a disk block. This is the only routine in which actual disk
|
||||
@@ -362,7 +362,7 @@ register struct buf *bp; /* buffer pointer */
|
||||
/*===========================================================================*
|
||||
* invalidate *
|
||||
*===========================================================================*/
|
||||
PUBLIC void invalidate(
|
||||
void invalidate(
|
||||
dev_t device /* device whose blocks are to be purged */
|
||||
)
|
||||
{
|
||||
@@ -400,7 +400,7 @@ int block_write_ok(struct buf *bp)
|
||||
/*===========================================================================*
|
||||
* flushall *
|
||||
*===========================================================================*/
|
||||
PUBLIC void flushall(
|
||||
void flushall(
|
||||
dev_t dev /* device to flush */
|
||||
)
|
||||
{
|
||||
@@ -437,7 +437,7 @@ PUBLIC void flushall(
|
||||
/*===========================================================================*
|
||||
* rw_scattered *
|
||||
*===========================================================================*/
|
||||
PUBLIC void rw_scattered(
|
||||
void rw_scattered(
|
||||
dev_t dev, /* major-minor device number */
|
||||
struct buf **bufq, /* pointer to array of buffers */
|
||||
int bufqsize, /* number of buffers */
|
||||
@@ -540,7 +540,7 @@ PUBLIC void rw_scattered(
|
||||
/*===========================================================================*
|
||||
* rm_lru *
|
||||
*===========================================================================*/
|
||||
PRIVATE void rm_lru(bp)
|
||||
static void rm_lru(bp)
|
||||
struct buf *bp;
|
||||
{
|
||||
/* Remove a block from its LRU chain. */
|
||||
@@ -563,7 +563,7 @@ struct buf *bp;
|
||||
/*===========================================================================*
|
||||
* cache_resize *
|
||||
*===========================================================================*/
|
||||
PRIVATE void cache_resize(unsigned int blocksize, unsigned int bufs)
|
||||
static void cache_resize(unsigned int blocksize, unsigned int bufs)
|
||||
{
|
||||
struct buf *bp;
|
||||
struct inode *rip;
|
||||
@@ -588,7 +588,7 @@ PRIVATE void cache_resize(unsigned int blocksize, unsigned int bufs)
|
||||
/*===========================================================================*
|
||||
* bufs_heuristic *
|
||||
*===========================================================================*/
|
||||
PRIVATE int bufs_heuristic(struct super_block *sp)
|
||||
static int bufs_heuristic(struct super_block *sp)
|
||||
{
|
||||
u32_t btotal, bfree, bused;
|
||||
|
||||
@@ -601,7 +601,7 @@ PRIVATE int bufs_heuristic(struct super_block *sp)
|
||||
/*===========================================================================*
|
||||
* set_blocksize *
|
||||
*===========================================================================*/
|
||||
PUBLIC void set_blocksize(struct super_block *sp)
|
||||
void set_blocksize(struct super_block *sp)
|
||||
{
|
||||
int bufs;
|
||||
|
||||
@@ -626,7 +626,7 @@ PUBLIC void set_blocksize(struct super_block *sp)
|
||||
/*===========================================================================*
|
||||
* buf_pool *
|
||||
*===========================================================================*/
|
||||
PUBLIC void buf_pool(int new_nr_bufs)
|
||||
void buf_pool(int new_nr_bufs)
|
||||
{
|
||||
/* Initialize the buffer pool. */
|
||||
register struct buf *bp;
|
||||
|
||||
@@ -22,21 +22,21 @@
|
||||
#include "super.h"
|
||||
#include <minix/vfsif.h>
|
||||
|
||||
FORWARD void addhash_inode(struct inode *node);
|
||||
static void addhash_inode(struct inode *node);
|
||||
|
||||
FORWARD void free_inode(dev_t dev, ino_t numb);
|
||||
FORWARD void new_icopy(struct inode *rip, d2_inode *dip, int direction,
|
||||
static void free_inode(dev_t dev, ino_t numb);
|
||||
static void new_icopy(struct inode *rip, d2_inode *dip, int direction,
|
||||
int norm);
|
||||
FORWARD void old_icopy(struct inode *rip, d1_inode *dip, int direction,
|
||||
static void old_icopy(struct inode *rip, d1_inode *dip, int direction,
|
||||
int norm);
|
||||
FORWARD void unhash_inode(struct inode *node);
|
||||
FORWARD void wipe_inode(struct inode *rip);
|
||||
static void unhash_inode(struct inode *node);
|
||||
static void wipe_inode(struct inode *rip);
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_putnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_putnode(void)
|
||||
int fs_putnode(void)
|
||||
{
|
||||
/* Find the inode specified by the request message and decrease its counter.*/
|
||||
|
||||
@@ -74,7 +74,7 @@ PUBLIC int fs_putnode(void)
|
||||
/*===========================================================================*
|
||||
* init_inode_cache *
|
||||
*===========================================================================*/
|
||||
PUBLIC void init_inode_cache()
|
||||
void init_inode_cache()
|
||||
{
|
||||
struct inode *rip;
|
||||
struct inodelist *rlp;
|
||||
@@ -100,7 +100,7 @@ PUBLIC void init_inode_cache()
|
||||
/*===========================================================================*
|
||||
* addhash_inode *
|
||||
*===========================================================================*/
|
||||
PRIVATE void addhash_inode(struct inode *node)
|
||||
static void addhash_inode(struct inode *node)
|
||||
{
|
||||
int hashi = (int) (node->i_num & INODE_HASH_MASK);
|
||||
|
||||
@@ -112,7 +112,7 @@ PRIVATE void addhash_inode(struct inode *node)
|
||||
/*===========================================================================*
|
||||
* unhash_inode *
|
||||
*===========================================================================*/
|
||||
PRIVATE void unhash_inode(struct inode *node)
|
||||
static void unhash_inode(struct inode *node)
|
||||
{
|
||||
/* remove from hash table */
|
||||
LIST_REMOVE(node, i_hash);
|
||||
@@ -122,7 +122,7 @@ PRIVATE void unhash_inode(struct inode *node)
|
||||
/*===========================================================================*
|
||||
* get_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *get_inode(
|
||||
struct inode *get_inode(
|
||||
dev_t dev, /* device on which inode resides */
|
||||
ino_t numb /* inode number */
|
||||
)
|
||||
@@ -184,7 +184,7 @@ PUBLIC struct inode *get_inode(
|
||||
/*===========================================================================*
|
||||
* find_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *find_inode(
|
||||
struct inode *find_inode(
|
||||
dev_t dev, /* device on which inode resides */
|
||||
ino_t numb /* inode number */
|
||||
)
|
||||
@@ -210,7 +210,7 @@ PUBLIC struct inode *find_inode(
|
||||
/*===========================================================================*
|
||||
* put_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void put_inode(rip)
|
||||
void put_inode(rip)
|
||||
register struct inode *rip; /* pointer to inode to be released */
|
||||
{
|
||||
/* The caller is no longer using this inode. If no one else is using it either
|
||||
@@ -256,7 +256,7 @@ register struct inode *rip; /* pointer to inode to be released */
|
||||
/*===========================================================================*
|
||||
* alloc_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *alloc_inode(dev_t dev, mode_t bits)
|
||||
struct inode *alloc_inode(dev_t dev, mode_t bits)
|
||||
{
|
||||
/* Allocate a free inode on 'dev', and return a pointer to it. */
|
||||
|
||||
@@ -313,7 +313,7 @@ PUBLIC struct inode *alloc_inode(dev_t dev, mode_t bits)
|
||||
/*===========================================================================*
|
||||
* wipe_inode *
|
||||
*===========================================================================*/
|
||||
PRIVATE void wipe_inode(rip)
|
||||
static void wipe_inode(rip)
|
||||
register struct inode *rip; /* the inode to be erased */
|
||||
{
|
||||
/* Erase some fields in the inode. This function is called from alloc_inode()
|
||||
@@ -332,7 +332,7 @@ register struct inode *rip; /* the inode to be erased */
|
||||
/*===========================================================================*
|
||||
* free_inode *
|
||||
*===========================================================================*/
|
||||
PRIVATE void free_inode(
|
||||
static void free_inode(
|
||||
dev_t dev, /* on which device is the inode? */
|
||||
ino_t inumb /* number of the inode to be freed */
|
||||
)
|
||||
@@ -354,7 +354,7 @@ PRIVATE void free_inode(
|
||||
/*===========================================================================*
|
||||
* update_times *
|
||||
*===========================================================================*/
|
||||
PUBLIC void update_times(rip)
|
||||
void update_times(rip)
|
||||
register struct inode *rip; /* pointer to inode to be read/written */
|
||||
{
|
||||
/* Various system calls are required by the standard to update atime, ctime,
|
||||
@@ -380,7 +380,7 @@ register struct inode *rip; /* pointer to inode to be read/written */
|
||||
/*===========================================================================*
|
||||
* rw_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void rw_inode(rip, rw_flag)
|
||||
void rw_inode(rip, rw_flag)
|
||||
register struct inode *rip; /* pointer to inode to be read/written */
|
||||
int rw_flag; /* READING or WRITING */
|
||||
{
|
||||
@@ -424,7 +424,7 @@ int rw_flag; /* READING or WRITING */
|
||||
/*===========================================================================*
|
||||
* old_icopy *
|
||||
*===========================================================================*/
|
||||
PRIVATE void old_icopy(rip, dip, direction, norm)
|
||||
static void old_icopy(rip, dip, direction, norm)
|
||||
register struct inode *rip; /* pointer to the in-core inode struct */
|
||||
register d1_inode *dip; /* pointer to the d1_inode inode struct */
|
||||
int direction; /* READING (from disk) or WRITING (to disk) */
|
||||
@@ -470,7 +470,7 @@ int norm; /* TRUE = do not swap bytes; FALSE = swap */
|
||||
/*===========================================================================*
|
||||
* new_icopy *
|
||||
*===========================================================================*/
|
||||
PRIVATE void new_icopy(rip, dip, direction, norm)
|
||||
static void new_icopy(rip, dip, direction, norm)
|
||||
register struct inode *rip; /* pointer to the in-core inode struct */
|
||||
register d2_inode *dip; /* pointer to the d2_inode struct */
|
||||
int direction; /* READING (from disk) or WRITING (to disk) */
|
||||
@@ -513,7 +513,7 @@ int norm; /* TRUE = do not swap bytes; FALSE = swap */
|
||||
/*===========================================================================*
|
||||
* dup_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void dup_inode(ip)
|
||||
void dup_inode(ip)
|
||||
struct inode *ip; /* The inode to be duplicated. */
|
||||
{
|
||||
/* This routine is a simplified form of get_inode() for the case where
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
#define SAME 1000
|
||||
|
||||
|
||||
FORWARD int freesp_inode(struct inode *rip, off_t st, off_t end);
|
||||
FORWARD int remove_dir(struct inode *rldirp, struct inode *rip, char
|
||||
static int freesp_inode(struct inode *rip, off_t st, off_t end);
|
||||
static int remove_dir(struct inode *rldirp, struct inode *rip, char
|
||||
dir_name[MFS_NAME_MAX]);
|
||||
FORWARD int unlink_file(struct inode *dirp, struct inode *rip, char
|
||||
static int unlink_file(struct inode *dirp, struct inode *rip, char
|
||||
file_name[MFS_NAME_MAX]);
|
||||
FORWARD off_t nextblock(off_t pos, int zone_size);
|
||||
FORWARD void zerozone_half(struct inode *rip, off_t pos, int half, int
|
||||
static off_t nextblock(off_t pos, int zone_size);
|
||||
static void zerozone_half(struct inode *rip, off_t pos, int half, int
|
||||
zone_size);
|
||||
FORWARD void zerozone_range(struct inode *rip, off_t pos, off_t len);
|
||||
static void zerozone_range(struct inode *rip, off_t pos, off_t len);
|
||||
|
||||
/* Args to zerozone_half() */
|
||||
#define FIRST_HALF 0
|
||||
@@ -28,7 +28,7 @@ FORWARD void zerozone_range(struct inode *rip, off_t pos, off_t len);
|
||||
/*===========================================================================*
|
||||
* fs_link *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_link()
|
||||
int fs_link()
|
||||
{
|
||||
/* Perform the link(name1, name2) system call. */
|
||||
|
||||
@@ -108,7 +108,7 @@ PUBLIC int fs_link()
|
||||
/*===========================================================================*
|
||||
* fs_unlink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_unlink()
|
||||
int fs_unlink()
|
||||
{
|
||||
/* Perform the unlink(name) or rmdir(name) system call. The code for these two
|
||||
* is almost the same. They differ only in some condition testing. Unlink()
|
||||
@@ -170,7 +170,7 @@ PUBLIC int fs_unlink()
|
||||
/*===========================================================================*
|
||||
* fs_rdlink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_rdlink()
|
||||
int fs_rdlink()
|
||||
{
|
||||
block_t b; /* block containing link text */
|
||||
struct buf *bp; /* buffer containing link text */
|
||||
@@ -210,7 +210,7 @@ PUBLIC int fs_rdlink()
|
||||
/*===========================================================================*
|
||||
* remove_dir *
|
||||
*===========================================================================*/
|
||||
PRIVATE int remove_dir(rldirp, rip, dir_name)
|
||||
static int remove_dir(rldirp, rip, dir_name)
|
||||
struct inode *rldirp; /* parent directory */
|
||||
struct inode *rip; /* directory to be removed */
|
||||
char dir_name[MFS_NAME_MAX]; /* name of directory to be removed */
|
||||
@@ -246,7 +246,7 @@ char dir_name[MFS_NAME_MAX]; /* name of directory to be removed */
|
||||
/*===========================================================================*
|
||||
* unlink_file *
|
||||
*===========================================================================*/
|
||||
PRIVATE int unlink_file(dirp, rip, file_name)
|
||||
static int unlink_file(dirp, rip, file_name)
|
||||
struct inode *dirp; /* parent directory of file */
|
||||
struct inode *rip; /* inode of file, may be NULL too. */
|
||||
char file_name[MFS_NAME_MAX]; /* name of file to be removed */
|
||||
@@ -282,7 +282,7 @@ char file_name[MFS_NAME_MAX]; /* name of file to be removed */
|
||||
/*===========================================================================*
|
||||
* fs_rename *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_rename()
|
||||
int fs_rename()
|
||||
{
|
||||
/* Perform the rename(name1, name2) system call. */
|
||||
struct inode *old_dirp, *old_ip; /* ptrs to old dir, file inodes */
|
||||
@@ -487,7 +487,7 @@ PUBLIC int fs_rename()
|
||||
/*===========================================================================*
|
||||
* fs_ftrunc *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_ftrunc(void)
|
||||
int fs_ftrunc(void)
|
||||
{
|
||||
struct inode *rip;
|
||||
off_t start, end;
|
||||
@@ -515,7 +515,7 @@ PUBLIC int fs_ftrunc(void)
|
||||
/*===========================================================================*
|
||||
* truncate_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int truncate_inode(rip, newsize)
|
||||
int truncate_inode(rip, newsize)
|
||||
register struct inode *rip; /* pointer to inode to be truncated */
|
||||
off_t newsize; /* inode must become this size */
|
||||
{
|
||||
@@ -559,7 +559,7 @@ off_t newsize; /* inode must become this size */
|
||||
/*===========================================================================*
|
||||
* freesp_inode *
|
||||
*===========================================================================*/
|
||||
PRIVATE int freesp_inode(rip, start, end)
|
||||
static int freesp_inode(rip, start, end)
|
||||
register struct inode *rip; /* pointer to inode to be partly freed */
|
||||
off_t start, end; /* range of bytes to free (end uninclusive) */
|
||||
{
|
||||
@@ -623,7 +623,7 @@ off_t start, end; /* range of bytes to free (end uninclusive) */
|
||||
/*===========================================================================*
|
||||
* nextblock *
|
||||
*===========================================================================*/
|
||||
PRIVATE off_t nextblock(pos, zone_size)
|
||||
static off_t nextblock(pos, zone_size)
|
||||
off_t pos;
|
||||
int zone_size;
|
||||
{
|
||||
@@ -641,7 +641,7 @@ int zone_size;
|
||||
/*===========================================================================*
|
||||
* zerozone_half *
|
||||
*===========================================================================*/
|
||||
PRIVATE void zerozone_half(rip, pos, half, zone_size)
|
||||
static void zerozone_half(rip, pos, half, zone_size)
|
||||
struct inode *rip;
|
||||
off_t pos;
|
||||
int half;
|
||||
@@ -672,7 +672,7 @@ int zone_size;
|
||||
/*===========================================================================*
|
||||
* zerozone_range *
|
||||
*===========================================================================*/
|
||||
PRIVATE void zerozone_range(rip, pos, len)
|
||||
static void zerozone_range(rip, pos, len)
|
||||
struct inode *rip;
|
||||
off_t pos;
|
||||
off_t len;
|
||||
|
||||
@@ -12,18 +12,18 @@
|
||||
|
||||
|
||||
/* Declare some local functions. */
|
||||
FORWARD void get_work(message *m_in);
|
||||
FORWARD void reply(endpoint_t who, message *m_out);
|
||||
static void get_work(message *m_in);
|
||||
static void reply(endpoint_t who, message *m_out);
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
FORWARD void sef_cb_signal_handler(int signo);
|
||||
static void sef_local_startup(void);
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
static void sef_cb_signal_handler(int signo);
|
||||
|
||||
/*===========================================================================*
|
||||
* main *
|
||||
*===========================================================================*/
|
||||
PUBLIC int main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
/* This is the main routine of this service. The main loop consists of
|
||||
* three major activities: getting new work, processing the work, and
|
||||
@@ -84,7 +84,7 @@ PUBLIC int main(int argc, char *argv[])
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -102,7 +102,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
{
|
||||
/* Initialize the Minix file server. */
|
||||
int i;
|
||||
@@ -127,7 +127,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
/*===========================================================================*
|
||||
* sef_cb_signal_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_cb_signal_handler(int signo)
|
||||
static void sef_cb_signal_handler(int signo)
|
||||
{
|
||||
/* Only check for termination signal, ignore anything else. */
|
||||
if (signo != SIGTERM) return;
|
||||
@@ -144,7 +144,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
|
||||
/*===========================================================================*
|
||||
* get_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void get_work(m_in)
|
||||
static void get_work(m_in)
|
||||
message *m_in; /* pointer to message */
|
||||
{
|
||||
int r, srcok = 0;
|
||||
@@ -172,7 +172,7 @@ message *m_in; /* pointer to message */
|
||||
/*===========================================================================*
|
||||
* reply *
|
||||
*===========================================================================*/
|
||||
PRIVATE void reply(
|
||||
static void reply(
|
||||
endpoint_t who,
|
||||
message *m_out /* report result */
|
||||
)
|
||||
@@ -186,7 +186,7 @@ PRIVATE void reply(
|
||||
/*===========================================================================*
|
||||
* cch_check *
|
||||
*===========================================================================*/
|
||||
PRIVATE void cch_check(void)
|
||||
static void cch_check(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_sync *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_sync()
|
||||
int fs_sync()
|
||||
{
|
||||
/* Perform the sync() system call. Flush all the tables.
|
||||
* The order in which the various tables are flushed is critical. The
|
||||
@@ -37,7 +37,7 @@ PUBLIC int fs_sync()
|
||||
/*===========================================================================*
|
||||
* fs_flush *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_flush()
|
||||
int fs_flush()
|
||||
{
|
||||
/* Flush the blocks of a device from the cache after writing any dirty blocks
|
||||
* to disk.
|
||||
@@ -55,7 +55,7 @@ PUBLIC int fs_flush()
|
||||
/*===========================================================================*
|
||||
* fs_new_driver *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_new_driver(void)
|
||||
int fs_new_driver(void)
|
||||
{
|
||||
/* Set a new driver endpoint for this device. */
|
||||
dev_t dev;
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include <minix/vfsif.h>
|
||||
#include <minix/bdev.h>
|
||||
|
||||
PRIVATE int cleanmount = 1;
|
||||
static int cleanmount = 1;
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_readsuper *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_readsuper()
|
||||
int fs_readsuper()
|
||||
{
|
||||
/* This function reads the superblock of the partition, gets the root inode
|
||||
* and sends back the details of them. Note, that the FS process does not
|
||||
@@ -122,7 +122,7 @@ PUBLIC int fs_readsuper()
|
||||
/*===========================================================================*
|
||||
* fs_mountpoint *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_mountpoint()
|
||||
int fs_mountpoint()
|
||||
{
|
||||
/* This function looks up the mount point, it checks the condition whether
|
||||
* the partition can be mounted on the inode or not.
|
||||
@@ -153,7 +153,7 @@ PUBLIC int fs_mountpoint()
|
||||
/*===========================================================================*
|
||||
* fs_unmount *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_unmount()
|
||||
int fs_unmount()
|
||||
{
|
||||
/* Unmount a file system by device number. */
|
||||
int count;
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
#include "super.h"
|
||||
#include <minix/vfsif.h>
|
||||
|
||||
FORWARD struct inode *new_node(struct inode *ldirp, char *string, mode_t
|
||||
static struct inode *new_node(struct inode *ldirp, char *string, mode_t
|
||||
bits, zone_t z0);
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_create *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_create()
|
||||
int fs_create()
|
||||
{
|
||||
size_t len;
|
||||
int r;
|
||||
@@ -70,7 +70,7 @@ PUBLIC int fs_create()
|
||||
/*===========================================================================*
|
||||
* fs_mknod *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_mknod()
|
||||
int fs_mknod()
|
||||
{
|
||||
struct inode *ip, *ldirp;
|
||||
char lastc[MFS_NAME_MAX];
|
||||
@@ -103,7 +103,7 @@ PUBLIC int fs_mknod()
|
||||
/*===========================================================================*
|
||||
* fs_mkdir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_mkdir()
|
||||
int fs_mkdir()
|
||||
{
|
||||
int r1, r2; /* status codes */
|
||||
ino_t dot, dotdot; /* inode numbers for . and .. */
|
||||
@@ -169,7 +169,7 @@ PUBLIC int fs_mkdir()
|
||||
/*===========================================================================*
|
||||
* fs_slink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_slink()
|
||||
int fs_slink()
|
||||
{
|
||||
phys_bytes len;
|
||||
struct inode *sip; /* inode containing symbolic link */
|
||||
@@ -243,7 +243,7 @@ PUBLIC int fs_slink()
|
||||
/*===========================================================================*
|
||||
* new_node *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct inode *new_node(struct inode *ldirp,
|
||||
static struct inode *new_node(struct inode *ldirp,
|
||||
char *string, mode_t bits, zone_t z0)
|
||||
{
|
||||
/* New_node() is called by fs_open(), fs_mknod(), and fs_mkdir().
|
||||
@@ -318,7 +318,7 @@ PRIVATE struct inode *new_node(struct inode *ldirp,
|
||||
/*===========================================================================*
|
||||
* fs_inhibread *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_inhibread()
|
||||
int fs_inhibread()
|
||||
{
|
||||
struct inode *rip;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user