VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/util/net_internals.h@ 33548

Last change on this file since 33548 was 33116, checked in by vboxsync, 14 years ago

wddm/3d: chromium hgsmi transport (guest part, disabled)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.0 KB
Line 
1#ifndef NET_INTERNALS_H
2#define NET_INTERNALS_H
3
4#include "cr_bufpool.h"
5#include "cr_threads.h"
6
7#ifndef WINDOWS
8#include <sys/time.h>
9#endif
10
11/*
12 * DevNull network interface
13 */
14extern void crDevnullInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
15extern void crDevnullConnection( CRConnection *conn );
16extern int crDevnullRecv( void );
17extern CRConnection** crDevnullDump( int *num );
18
19
20/*
21 * File network interface
22 */
23extern void crFileInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
24extern void crFileConnection( CRConnection *conn );
25extern int crFileRecv( void );
26extern CRConnection** crFileDump( int *num );
27
28
29/*
30 * TCP/IP network interface
31 */
32typedef enum {
33 CRTCPIPMemory,
34 CRTCPIPMemoryBig
35} CRTCPIPBufferKind;
36
37#define CR_TCPIP_BUFFER_MAGIC 0x89134532
38
39typedef struct CRTCPIPBuffer {
40 unsigned int magic;
41 CRTCPIPBufferKind kind;
42 unsigned int len;
43 unsigned int allocated;
44 unsigned int pad; /* may be clobbered by crTCPIPSend() */
45} CRTCPIPBuffer;
46
47typedef struct {
48 int initialized;
49 int num_conns;
50 CRConnection **conns;
51 CRBufferPool *bufpool;
52#ifdef CHROMIUM_THREADSAFE
53 CRmutex mutex;
54 CRmutex recvmutex;
55#endif
56 CRNetReceiveFuncList *recv_list;
57 CRNetCloseFuncList *close_list;
58 CRSocket server_sock;
59} cr_tcpip_data;
60
61extern cr_tcpip_data cr_tcpip;
62
63extern void crTCPIPInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
64extern void crTCPIPConnection( CRConnection *conn );
65extern int crTCPIPRecv( void );
66extern CRConnection** crTCPIPDump( int *num );
67extern int crTCPIPDoConnect( CRConnection *conn );
68extern void crTCPIPDoDisconnect( CRConnection *conn );
69extern int crTCPIPErrno( void );
70extern char *crTCPIPErrorString( int err );
71extern void crTCPIPAccept( CRConnection *conn, const char *hostname, unsigned short port );
72extern void crTCPIPWriteExact( CRConnection *conn, const void *buf, unsigned int len );
73extern void crTCPIPFree( CRConnection *conn, void *buf );
74extern void *crTCPIPAlloc( CRConnection *conn );
75extern void crTCPIPReadExact( CRConnection *conn, void *buf, unsigned int len );
76extern int __tcpip_write_exact( CRSocket sock, const void *buf, unsigned int len );
77extern int __tcpip_read_exact( CRSocket sock, void *buf, unsigned int len );
78extern void __tcpip_dead_connection( CRConnection *conn );
79extern int __crSelect( int n, fd_set *readfds, int sec, int usec );
80
81
82/*
83 * UDP network interface
84 */
85extern void crUDPTCPIPInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
86extern void crUDPTCPIPConnection( CRConnection *conn );
87extern int crUDPTCPIPRecv( void );
88
89/*
90 * VirtualBox HGCM
91 */
92#ifdef VBOX_WITH_HGCM
93extern void crVBoxHGCMInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
94extern void crVBoxHGCMConnection( CRConnection *conn );
95extern int crVBoxHGCMRecv( void );
96extern CRConnection** crVBoxHGCMDump( int *num );
97extern void crVBoxHGCMTearDown(void);
98#endif
99#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
100extern bool crVBoxHGSMIInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
101extern void crVBoxHGSMIConnection( CRConnection *conn );
102extern int crVBoxHGSMIRecv( void );
103extern CRConnection** crVBoxHGSMIDump( int *num );
104extern void crVBoxHGSMITearDown(void);
105#endif /* #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) */
106
107/*
108 * TEAC network interface
109 */
110#ifdef TEAC_SUPPORT
111extern void crTeacInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl,
112 unsigned int mtu );
113extern void crTeacConnection( CRConnection *conn );
114extern int crTeacRecv( void );
115extern void crTeacSetRank( int );
116extern void crTeacSetContextRange( int, int );
117extern void crTeacSetNodeRange( const char *, const char * );
118extern void crTeacSetKey( const unsigned char *key, const int keyLength );
119#endif /* TEAC_SUPPORT */
120
121
122/*
123 * Tcscomm network interface
124 */
125#ifdef TCSCOMM_SUPPORT
126extern void crTcscommInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl,
127 unsigned int mtu );
128extern void crTcscommConnection( CRConnection *conn );
129extern int crTcscommRecv( void );
130#endif /* TCSCOMM_SUPPORT */
131
132
133/*
134 * SDP network interface
135 */
136#ifdef SDP_SUPPORT
137extern const char *crGetSDPHostnameSuffix(void);
138extern void crSDPInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
139extern void crSDPConnection( CRConnection *conn );
140extern int crSDPRecv( void );
141extern CRConnection** crSDPDump( int *num );
142#endif /* SDP_SUPPORT */
143
144
145/*
146 * Infiniband network interface
147 */
148#ifdef IB_SUPPORT
149extern void crIBInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
150extern void crIBConnection( CRConnection *conn );
151extern int crIBRecv( void );
152extern CRConnection** crIBDump( int *num );
153#endif /* IB_SUPPORT */
154
155
156/*
157 * GM network interface
158 */
159#ifdef GM_SUPPORT
160extern void crGmInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
161extern void crGmConnection( CRConnection *conn );
162extern int crGmRecv( void );
163extern CRConnection** crGmDump( int *num );
164extern int crGmDoConnect( CRConnection *conn );
165extern void crGmDoDisconnect( CRConnection *conn );
166extern int crGmErrno( void );
167extern char *crGmErrorString( int err );
168extern void crGmAccept( CRConnection *conn, const char *hostname, unsigned short port );
169extern void crGmSendExact( CRConnection *conn, const void *buf, unsigned int len );
170extern void crGmFree( CRConnection *conn, void *buf );
171extern void *crGmAlloc( CRConnection *conn );
172extern void crGmReadExact( CRConnection *conn, void *buf, unsigned int len );
173extern void crGmBogusRecv( CRConnection *conn, void *buf, unsigned int len );
174extern void crGmHandleNewMessage( CRConnection *conn, CRMessage *msg, unsigned int len );
175extern void crGmInstantReclaim( CRConnection *conn, CRMessage *msg );
176extern unsigned int crGmNodeId( void );
177extern unsigned int crGmPortNum( void );
178#endif /* GM_SUPPORT */
179
180
181extern CRConnection** crNetDump( int *num );
182
183#endif /* NET_INTERNALS_H */
Note: See TracBrowser for help on using the repository browser.

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