VirtualBox

source: vbox/trunk/src/VBox/Devices/Network/slirp/misc.h@ 28449

Last change on this file since 28449 was 28449, checked in by vboxsync, 15 years ago

NAT: slirp file headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Id: misc.h 28449 2010-04-19 09:52:59Z vboxsync $ */
2/** @file
3 * NAT - helpers (declarations/defines).
4 */
5
6/*
7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22/*
23 * This code is based on:
24 *
25 * Copyright (c) 1995 Danny Gasparovski.
26 *
27 * Please read the file COPYRIGHT for the
28 * terms and conditions of the copyright.
29 */
30
31#ifndef _MISC_H_
32#define _MISC_H_
33
34#define EMU_NONE 0x0
35
36/* TCP emulations */
37#define EMU_CTL 0x1
38#define EMU_FTP 0x2
39#define EMU_KSH 0x3
40#define EMU_IRC 0x4
41#define EMU_REALAUDIO 0x5
42#define EMU_RLOGIN 0x6
43#define EMU_IDENT 0x7
44#define EMU_RSH 0x8
45
46#define EMU_NOCONNECT 0x10 /* Don't connect */
47
48/* UDP emulations */
49#define EMU_TALK 0x1
50#define EMU_NTALK 0x2
51#define EMU_CUSEEME 0x3
52
53struct tos_t
54{
55 u_int16_t lport;
56 u_int16_t fport;
57 u_int8_t tos;
58 u_int8_t emu;
59};
60
61struct emu_t
62{
63 u_int16_t lport;
64 u_int16_t fport;
65 u_int8_t tos;
66 u_int8_t emu;
67 struct emu_t *next;
68};
69
70extern struct emu_t *tcpemu;
71
72extern int x_port, x_server, x_display;
73
74int show_x (char *, struct socket *);
75void redir_x (u_int32_t, int, int, int);
76void getouraddr (PNATState);
77void slirp_insque (PNATState, void *, void *);
78void slirp_remque (PNATState, void *);
79int slirp_openpty (int *, int *);
80int fork_exec (PNATState, struct socket *, char *, int);
81void snooze_hup (int);
82void snooze (void);
83void relay (int);
84void add_emu (char *);
85void fd_nonblock (int);
86void fd_block (int);
87
88#ifdef VBOX_WITH_SLIRP_BSD_MBUF
89/* UVM interface */
90#define UMA_ALIGN_PTR (1 << 0)
91#define UMA_ZONE_REFCNT (1 << 1)
92#define UMA_ZONE_MAXBUCKET (1 << 2)
93#define UMA_ZONE_ZINIT (1 << 3)
94#define UMA_SLAB_KERNEL (1 << 4)
95#define UMA_ZFLAG_FULL (1 << 5)
96
97struct uma_zone;
98typedef struct uma_zone *uma_zone_t;
99typedef void *(*uma_alloc_t)(uma_zone_t, int, u_int8_t *, int);
100typedef void (*uma_free_t)(void *, int, u_int8_t);
101
102typedef int (*ctor_t)(PNATState, void *, int, void *, int);
103typedef void (*dtor_t)(PNATState, void *, int, void *);
104typedef int (*zinit_t)(PNATState, void *, int, int);
105typedef void (*zfini_t)(PNATState, void *, int);
106uma_zone_t uma_zcreate(PNATState, char *, size_t, ctor_t, dtor_t, zinit_t, zfini_t, int, int);
107uma_zone_t uma_zsecond_create(char *, ctor_t, dtor_t, zinit_t, zfini_t, uma_zone_t);
108void uma_zone_set_max(uma_zone_t, int);
109void uma_zone_set_allocf(uma_zone_t, uma_alloc_t);
110void uma_zone_set_freef(uma_zone_t, uma_free_t);
111
112uint32_t *uma_find_refcnt(uma_zone_t, void *);
113void *uma_zalloc(uma_zone_t, int);
114void *uma_zalloc_arg(uma_zone_t, void *, int);
115void uma_zfree(uma_zone_t, void *);
116void uma_zfree_arg(uma_zone_t, void *, void *);
117int uma_zone_exhausted_nolock(uma_zone_t);
118void zone_drain(uma_zone_t);
119
120void slirp_null_arg_free(void *, void *);
121void m_fini(PNATState pData);
122#endif /* VBOX_WITH_SLIRP_BSD_MBUF */
123
124#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette