source: rtems/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h @ 19642e2c

4.104.114.84.95
Last change on this file since 19642e2c was 19642e2c, checked in by Joel Sherrill <joel.sherrill@…>, on 01/10/00 at 21:22:23

Removed definition of USHRT_MAX to remove lots of redefinition warnings.

  • Property mode set to 100644
File size: 5.0 KB
Line 
1/*
2 * Declarations to fit FreeBSD to RTEMS.
3 *
4 *******************************************************************
5 *                            WARNING                              *
6 * This file should *never* be included by any application program *
7 *******************************************************************
8 *
9 *  $Id$
10 */
11
12#ifndef _RTEMS_BSDNET_INTERNAL_H_
13#define _RTEMS_BSDNET_INTERNAL_H_
14
15typedef unsigned int            vm_offset_t;
16typedef long long               vm_ooffset_t;
17typedef unsigned int            vm_pindex_t;
18typedef unsigned int            vm_size_t;
19
20#define _BSD_OFF_T_     rtems_signed32
21#define _BSD_PID_T_     rtems_id
22#define _BSD_VA_LIST_   char *
23
24/* make sure we get the network versions of these */
25#include "../machine/types.h"
26#include "../machine/param.h"
27
28#include <sys/time.h>
29struct  itimerval {
30  struct  timeval it_interval;
31  struct  timeval it_value;
32};
33struct mdproc {
34        int     md_flags;
35        int     *md_regs;
36};
37
38#define USHRT_MAX       65535
39
40/*
41 * Other RTEMS/BSD glue
42 */
43struct socket;
44extern int soconnsleep (struct socket *so);
45extern void soconnwakeup (struct socket *so);
46#define splnet()        0
47#define splimp()        0
48#define splx(_s)        do { (_s) = 0; } while(0)
49
50#define ovbcopy(f,t,n) bcopy(f,t,n)
51#define copyout(f,t,n) (memcpy(t,f,n),0)
52#define copyin(f,t,n) (memcpy(t,f,n),0)
53
54#define random()        rtems_bsdnet_random()
55#define panic   rtems_panic
56#define suser(a,b)      0
57
58void    microtime (struct timeval *tv);
59#define hz rtems_bsdnet_ticks_per_second
60#define tick rtems_bsdnet_microseconds_per_tick
61
62#define log     rtems_bsdnet_log
63
64/*
65 * Since we can't have two sys/types.h files, we'll hack around
66 * and copy the contents of the BSD sys/types.h to here....
67 */
68#include <sys/cdefs.h>
69
70typedef u_int64_t       u_quad_t;       /* quads */
71typedef int64_t         quad_t;
72typedef quad_t *        qaddr_t;
73
74typedef void __sighandler_t __P((int));
75typedef __sighandler_t  *sig_t; /* type of pointer to a signal function */
76#define NSIG    32
77struct  sigaltstack {
78        char    *ss_sp;                 /* signal stack base */
79        int     ss_size;                /* signal stack length */
80        int     ss_flags;               /* SS_DISABLE and/or SS_ONSTACK */
81};
82
83#ifdef KERNEL
84typedef int             boolean_t;
85typedef struct vm_page  *vm_page_t;
86#endif
87
88#ifndef _POSIX_SOURCE
89/*
90 * minor() gives a cookie instead of an index since we don't want to
91 * change the meanings of bits 0-15 or waste time and space shifting
92 * bits 16-31 for devices that don't use them.
93 */
94#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
95#define minor(x)        ((int)((x)&0xffff00ff))         /* minor number */
96#define makedev(x,y)    ((dev_t)(((x) << 8) | (y)))     /* create dev_t */
97#endif
98
99#include <machine/endian.h>
100
101typedef quad_t          rlim_t;         /* resource limit */
102typedef u_int32_t       fixpt_t;        /* fixed point number */
103
104/*
105 * Forward structure declarations for function prototypes.  We include the
106 * common structures that cross subsystem boundaries here; others are mostly
107 * used in the same place that the structure is defined.
108 */
109struct  proc;
110struct  pgrp;
111struct  ucred;
112struct  rusage;
113struct  file;
114struct  buf;
115struct  tty;
116struct  uio;
117struct  rtems_bsdnet_ifconfig;
118
119/*
120 * Redo kernel memory allocation
121 */
122#define malloc rtems_bsdnet_malloc
123#define free rtems_bsdnet_free
124
125#define M_NOWAIT        0x0001
126void *rtems_bsdnet_malloc (unsigned long size, int type, int flags);
127void rtems_bsdnet_free (void *addr, int type);
128
129void rtems_bsdnet_semaphore_obtain (void);
130void rtems_bsdnet_semaphore_release (void);
131void rtems_bsdnet_schednetisr (int n);
132int rtems_bsdnet_parse_driver_name (const struct rtems_bsdnet_ifconfig *config, char **namep);
133
134unsigned long rtems_bsdnet_seconds_since_boot (void);
135unsigned long rtems_bsdnet_random (void);
136
137rtems_id rtems_bsdnet_newproc (
138  char  *name,
139  int   stacksize,
140  void  (*entry)(void *),
141  void  *arg
142);
143
144rtems_status_code rtems_bsdnet_event_receive (
145  rtems_event_set  event_in,
146  rtems_option     option_set,
147  rtems_interval   ticks,
148  rtems_event_set *event_out
149);
150
151/*
152 * Network configuration
153 */
154extern int rtems_bsdnet_ticks_per_second;
155extern int rtems_bsdnet_microseconds_per_tick;
156extern struct in_addr rtems_bsdnet_log_host_address;
157extern char *rtems_bsdnet_domain_name;
158extern struct in_addr rtems_bsdnet_nameserver[];
159extern int rtems_bsdnet_nameserver_count;
160
161/*
162 * Internal IOCTL command
163 */
164#define SIO_RTEMS_SHOW_STATS    _IO('i', 250)
165
166/*
167 * Some extra prototypes
168 */
169int sethostname (char *name, size_t namelen);
170void domaininit (void *);
171void ifinit (void *);
172void ipintr (void);
173void arpintr (void);
174void bootpc_init(void);
175int socket (int, int, int);
176int ioctl (int, int, ...);
177
178/*
179 * Events used by networking routines.
180 * Everything will break if the application
181 * tries to use these events or if the `sleep'
182 * events are equal to any of the NETISR * events.
183 */
184#define SBWAIT_EVENT   RTEMS_EVENT_24
185#define SOSLEEP_EVENT  RTEMS_EVENT_25
186#define NETISR_IP_EVENT                (1 << NETISR_IP)
187#define NETISR_ARP_EVENT       (1 << NETISR_ARP)
188#define NETISR_EVENTS  (NETISR_IP_EVENT|NETISR_ARP_EVENT)
189#if (SBWAIT_EVENT & SOSLEEP_EVENT & NETISR_EVENTS)
190# error "Network event conflict"
191#endif
192
193#endif /* _RTEMS_BSDNET_INTERNAL_H_ */
Note: See TracBrowser for help on using the repository browser.