NetSim Source Code Help v14.4
All 13 Components
 
Loading...
Searching...
No Matches
CLIInterface.h
1#pragma once
2/************************************************************************************
3* Copyright (C) 2023 *
4* TETCOS, Bangalore. India *
5* *
6* Tetcos owns the intellectual property rights in the Product and its content. *
7* The copying, redistribution, reselling or publication of any or all of the *
8* Product or its content without express prior written consent of Tetcos is *
9* prohibited. Ownership and / or any other right relating to the software and all *
10* intellectual property rights therein shall remain at all times with Tetcos. *
11* *
12* This source code is licensed per the NetSim license agreement. *
13* *
14* No portion of this source code may be used as the basis for a derivative work, *
15* or used, for any purpose other than its intended use per the NetSim license *
16* agreement. *
17* *
18* This source code and the algorithms contained within it are confidential trade *
19* secrets of TETCOS and may not be used as the basis for any other software, *
20* hardware, product or service. *
21* *
22* Author: Shashi Kant Suman *
23* *
24* ----------------------------------------------------------------------------------*/
25
26/* ,~~. *
27 * ( 6 )-_, *
28 * (\___ )=='-'
29 * \ . ) )
30 * \ `-' /
31 * ~'`~'`~'`~'`~
32 *
33 * *
34 * ---------------------------------------------------------------------------------*/
35#ifndef _NETSIM_CLIINTERFACE_H_
36#define _NETSIM_CLIINTERFACE_H_
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#ifndef _DONT_INCLUDE_CLI_LIB_
42#pragma comment(lib,"libCLI.lib")
43#endif
44
45#ifndef NETSIM_ID
46#define NETSIM_ID UINT
47#endif
48
49 typedef struct stru_cli_info
50 {
51 char* inputFileName;
52 int(*fnHandleTimerEvent)();
53 }CLIINFO, *ptrCLIINFO;
54
55 /*
56 A Struct for hold 2D-array with count items
57 */
58 typedef struct stru_commandArray {
59 char* originalCommand;
60 char **commands;
61 int length;
62 } COMMANDARRAY, *ptrCOMMANDARRAY;
63
64 typedef void* CLIHANDLE;
65 _declspec(dllexport) ptrCOMMANDARRAY CLI_GET_CMDARRAY_FROM_HANDLE(CLIHANDLE handle);
66 _declspec(dllexport) void CLI_SEND_MESSAGE(CLIHANDLE handle,
67 char* msg,
68 ...);
69 _declspec(dllexport) void CLI_STOP_WAITING(CLIHANDLE handle);
70 _declspec(dllexport) ptrCOMMANDARRAY remove_first_word_from_commandArray(ptrCOMMANDARRAY c);
71 _declspec(dllexport) char* CLI_EXECUTE_COMMAND(ptrCOMMANDARRAY cmd,
72 NETSIM_ID d,
73 int* len,
74 bool(*multResp)(void*, char* msg, int len, bool isMore),
75 void* arg,
76 bool* isMore);
77 _declspec(dllexport) void CLI_PRINT_MESSAGE(CLIHANDLE handle, char* msg, int len);
78
79#ifdef __cplusplus
80}
81
82#endif
83#endif //_NETSIM_CLIINTERFACE_H_