comparison src/gpf/tst/drv/socket.h @ 6:8b2a9a374324

src/gpf: addition of Magnetite src/gpf2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 08:15:49 +0000
parents
children
comparison
equal deleted inserted replaced
5:1ea54a97e831 6:8b2a9a374324
1 /*
2 +------------------------------------------------------------------------------
3 | File: socket.h
4 +------------------------------------------------------------------------------
5 | Copyright 2002 Texas Instruments Berlin, AG
6 | All rights reserved.
7 |
8 | This file is confidential and a trade secret of Texas
9 | Instruments Berlin, AG
10 | The receipt of or possession of this file does not convey
11 | any rights to reproduce or disclose its contents or to
12 | manufacture, use, or sell anything it may describe, in
13 | whole, or in part, without the specific written consent of
14 | Texas Instruments Berlin, AG.
15 +-----------------------------------------------------------------------------
16 | Purpose : This Modul contains the serial driver adaptation
17 +-----------------------------------------------------------------------------
18 */
19
20 #ifndef SOCKET_H
21 #define SOCKET_H
22
23 /*==== INCLUDES =============================================================*/
24 #include "typedefs.h"
25 #include "gdi.h"
26
27 #ifdef _VXWORKS_
28 /* wha!??? */
29 #define SO_DONTLINGER (~SO_LINGER) /* Older SunOS compat. hack */
30 #define TCP_NODELAY 1
31 #endif
32
33 /*==== DEFINITIONS ==========================================================*/
34 #define SOCKET_SIGTYPE_CONNECT DRV_SIGTYPE_USER /* Connected event signal*/
35 #define SOCKET_SIGTYPE_RELEASE (DRV_SIGTYPE_USER+1)/* Released event signal */
36
37 #define SOCKET_ERRUNSPEC (DRV_RETVAL_USER+1)
38 #define SOCKET_NOCONNECT (DRV_RETVAL_USER+2)
39
40 #define SOCKET_INVALID_PORT 0
41 #define SOCKET_MAX_LEN_HOSTNAME 64
42
43 /*==== TYPES ================================================================*/
44 typedef struct
45 {
46 USHORT port;
47 USHORT tx_buffer_size ;
48 USHORT rx_buffer_size ;
49 ULONG tx_timeout_msec ;
50 ULONG rx_timeout_msec ;
51 char hostname[SOCKET_MAX_LEN_HOSTNAME+1] ;
52 USHORT config;
53 } socket_DCB_Type;
54
55 /*==== FUNCTIONS ============================================================*/
56 EXTERN USHORT socket_Init ( USHORT DrvHandle, T_DRV_CB_FUNC CallbackFunc, T_DRV_EXPORT const **DrvInfo ) ;
57 EXTERN void socket_Exit (void) ;
58 EXTERN USHORT socket_Open (void) ;
59 EXTERN USHORT socket_Close (void) ;
60 EXTERN USHORT socket_Read (void* out_BufferPtr, ULONG* thr_BufferSizePtr) ;
61 EXTERN USHORT socket_Write (void* in_BufferPtr, ULONG* thr_BufferSizePtr) ;
62 EXTERN USHORT socket_Flush (void) ;
63 EXTERN USHORT socket_SetSignal (USHORT SignalType) ;
64 EXTERN USHORT socket_ResetSignal (USHORT SignalType) ;
65 EXTERN USHORT socket_SetConfig (char* in_DCBPtr) ;
66 EXTERN USHORT socket_GetConfig (socket_DCB_Type* out_DCBPtr) ;
67
68 /*==== END OF FILE ==========================================================*/
69 #endif
70