File: wolfExamples.h

package info (click to toggle)
wolfssl 5.8.4-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 117,604 kB
  • sloc: ansic: 1,584,954; asm: 481,206; sh: 11,586; cs: 6,596; xml: 3,878; perl: 3,291; makefile: 2,058; ada: 1,891; javascript: 748; python: 636; cpp: 131; ruby: 118; objc: 80; tcl: 73
file content (47 lines) | stat: -rw-r--r-- 1,150 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _WOLFEXAMPLES_H_
#define _WOLFEXAMPLES_H_

#include <rt.h>

#ifdef __cplusplus
    extern "C" {
#endif

// support functions for all threads
BOOLEAN				Catalog(RTHANDLE hProcess, RTHANDLE hObject, LPSTR lpszName);
void				Cleanup(void);
void				Fail(LPSTR lpszMessage, ...);
DWORD				UsecsToKticks(DWORD dwUsecs);


/* Example API's */
int wolfExample_TLSServer(int port);
int wolfExample_TLSClient(const char* ip, int port);
int wolfExample_TLSLocal(int port);


// global type definitions
typedef enum {
	BEFORE_INIT,
	INIT_BUSY,
	INIT_DONE,
	CLEANUP_BUSY
}					INIT_STATE;

typedef struct {
	RTHANDLE			hMain;		// RTHANDLE of main thread
	INIT_STATE			state;		// main thread state
	BOOLEAN				bCataloged;	// TRUE if we cataloged process name in root
	BOOLEAN				bShutdown;	// TRUE if all threads have to terminate
}					INIT_STRUCT;

// global variables
extern RTHANDLE		hRootProcess;	// RTHANDLE of root process
extern DWORD		dwKtickInUsecs;	// length of one low level tick in usecs
extern INIT_STRUCT	gInit;			// structure describing all global objects

#ifdef __cplusplus
    }    /* extern "C" */
#endif

#endif /* _WOLFEXAMPLES_H_ */