|
|
1.1 ! root 1: /* ! 2: * Mach Operating System ! 3: * Copyright (c) 1991,1990,1989 Carnegie Mellon University ! 4: * All Rights Reserved. ! 5: * ! 6: * Permission to use, copy, modify and distribute this software and its ! 7: * documentation is hereby granted, provided that both the copyright ! 8: * notice and this permission notice appear in all copies of the ! 9: * software, derivative works or modified versions, and any portions ! 10: * thereof, and that both notices appear in supporting documentation. ! 11: * ! 12: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" ! 13: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR ! 14: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ! 15: * ! 16: * Carnegie Mellon requests users of this software to return to ! 17: * ! 18: * Software Distribution Coordinator or [email protected] ! 19: * School of Computer Science ! 20: * Carnegie Mellon University ! 21: * Pittsburgh PA 15213-3890 ! 22: * ! 23: * any improvements or extensions that they make and grant Carnegie Mellon ! 24: * the rights to redistribute these changes. ! 25: */ ! 26: /* ! 27: * Author: David B. Golub, Carnegie Mellon University ! 28: * Date: ll/89 ! 29: */ ! 30: ! 31: #ifndef _DEVICE_NET_IO_H_ ! 32: #define _DEVICE_NET_IO_H_ ! 33: ! 34: /* ! 35: * Utilities for playing with network messages. ! 36: */ ! 37: ! 38: #include <mach/machine/vm_types.h> ! 39: #include <ipc/ipc_kmsg.h> ! 40: ! 41: #include <kern/macro_help.h> ! 42: #include <kern/lock.h> ! 43: #include <kern/kalloc.h> ! 44: ! 45: #include <device/net_status.h> ! 46: ! 47: /* ! 48: * A network packet is wrapped in a kernel message while in ! 49: * the kernel. ! 50: */ ! 51: ! 52: #define net_kmsg(kmsg) ((net_rcv_msg_t)&(kmsg)->ikm_header) ! 53: ! 54: /* ! 55: * Interrupt routines may allocate and free net_kmsgs with these ! 56: * functions. net_kmsg_get may return IKM_NULL. ! 57: */ ! 58: ! 59: extern ipc_kmsg_t net_kmsg_get(); ! 60: extern void net_kmsg_put(); ! 61: ! 62: /* ! 63: * Network utility routines. ! 64: */ ! 65: ! 66: extern void net_packet(); ! 67: extern void net_filter(); ! 68: extern io_return_t net_getstat(); ! 69: extern io_return_t net_write(); ! 70: ! 71: /* ! 72: * Non-interrupt code may allocate and free net_kmsgs with these functions. ! 73: */ ! 74: ! 75: extern vm_size_t net_kmsg_size; ! 76: ! 77: #define net_kmsg_alloc() ((ipc_kmsg_t) kalloc(net_kmsg_size)) ! 78: #define net_kmsg_free(kmsg) kfree((vm_offset_t) (kmsg), net_kmsg_size) ! 79: ! 80: #endif /* _DEVICE_NET_IO_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.