quec_virt_func_proto_stack.c 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. /** @file
  2. quec_virt_func_proto_stack.c
  3. @brief
  4. This file is used to run virt function.
  5. */
  6. /*================================================================
  7. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  8. Quectel Wireless Solution Proprietary and Confidential.
  9. =================================================================*/
  10. /*=================================================================
  11. EDIT HISTORY FOR MODULE
  12. This section contains comments describing changes made to the module.
  13. Notice that changes are listed in reverse chronological order.
  14. WHEN WHO WHAT, WHERE, WHY
  15. ------------ ------- -------------------------------------------------------------------------------
  16. =================================================================*/
  17. #include "quec_atresp.h"
  18. #include "ql_uart_internal.h"
  19. #include "quec_cust_feature.h"
  20. #include "quec_common.h"
  21. #include "quec_at_param.h"
  22. #include "at_param.h"
  23. #include "ql_api_osi.h"
  24. #include "quec_at_engine.h"
  25. #include "quec_log.h"
  26. //#include "quec_rtos.h"
  27. #include "ql_api_osi.h"
  28. #include "ql_api_usbnet.h"
  29. #include "at_command.h"
  30. #define QUEC_VIRT_MODEM_FUNC_LOG(msg, ...) custom_log("VIRT_MFUNC", msg, ##__VA_ARGS__)
  31. //
  32. #ifndef CONFIG_QUEC_PROJECT_FEATURE_GPRS_DATA_TRANSFER
  33. __attribute__((weak)) bool ql_gprs_data_transfer_get_support(void)
  34. {
  35. return false;
  36. }
  37. __attribute__((weak)) unsigned char ql_gprs_data_transfer_get_sim_cid(void)
  38. {
  39. return 0;
  40. }
  41. __attribute__((weak)) void ql_gprs_data_transfer_input(void *payload, unsigned short tot_len)
  42. {
  43. }
  44. #endif/*CONFIG_QUEC_PROJECT_FEATURE_GPRS_DATA_TRANSFER*/
  45. #ifndef CONFIG_QUEC_PROJECT_FEATURE_FIREWALL
  46. __attribute__((weak)) int quec_firewall_ip4_input(struct pbuf* p, struct netif* inp)
  47. {
  48. return 0;
  49. }
  50. __attribute__((weak)) int quec_firewall_set_local_port(int s, int port)
  51. {
  52. return 0;
  53. }
  54. #endif
  55. #ifndef CONFIG_QUEC_PROJECT_FEATURE_SSH2
  56. __attribute__((weak)) const char *libssh2_session_banner_get(void *session)
  57. {
  58. return NULL;
  59. }
  60. __attribute__((weak)) int libssh2_channel_read_ex(void *channel, int stream_id, char *buf, size_t buflen)
  61. {
  62. return 0;
  63. }
  64. __attribute__((weak)) int libssh2_channel_write_ex(void *channel, int stream_id, char *buf, size_t buflen)
  65. {
  66. return 0;
  67. }
  68. __attribute__((weak)) int libssh2_session_block_directions(void *session)
  69. {
  70. return 0;
  71. }
  72. __attribute__((weak)) int libssh2_sftp_read(void *hnd, char *buffer, size_t buffer_maxlen)
  73. {
  74. return 0;
  75. }
  76. __attribute__((weak)) int libssh2_sftp_write(void *hnd, char *buffer, size_t buffer_maxlen)
  77. {
  78. return 0;
  79. }
  80. __attribute__((weak)) void libssh2_session_set_blocking(void *session, int blocking)
  81. {
  82. return;
  83. }
  84. __attribute__((weak)) int libssh2_knownhost_get(void *hosts, void *ext, void *oprev)
  85. {
  86. return 0;
  87. }
  88. __attribute__((weak)) int libssh2_session_method_pref(void *session, int method_type, const char *prefs)
  89. {
  90. return 0;
  91. }
  92. __attribute__((weak)) int libssh2_session_handshake(void *session, int sock)
  93. {
  94. return 0;
  95. }
  96. __attribute__((weak)) int libssh2_session_last_error(void *session, char **errmsg, int *errmsg_len, int want_buf)
  97. {
  98. return 0;
  99. }
  100. __attribute__((weak)) const char *libssh2_hostkey_hash(void *session, int hash_type)
  101. {
  102. return NULL;
  103. }
  104. __attribute__((weak)) const char *libssh2_session_hostkey(void *session, size_t *len, int *type)
  105. {
  106. return NULL;
  107. }
  108. __attribute__((weak)) int libssh2_knownhost_checkp(void *hosts, const char *hostp, int port, const char *key, size_t keylen, int typemask, void *ext)
  109. {
  110. return 0;
  111. }
  112. __attribute__((weak)) int libssh2_knownhost_del(void *hosts, void *entry)
  113. {
  114. return 0;
  115. }
  116. __attribute__((weak)) int libssh2_knownhost_add(void *hosts, void *entry)
  117. {
  118. return 0;
  119. }
  120. __attribute__((weak)) int libssh2_knownhost_writefile(void *hosts, const char *filename, int type)
  121. {
  122. return 0;
  123. }
  124. __attribute__((weak)) char *libssh2_userauth_list(void *session, const char *user, unsigned int user_len)
  125. {
  126. return 0;
  127. }
  128. __attribute__((weak)) int libssh2_userauth_authenticated(void *session)
  129. {
  130. return 0;
  131. }
  132. __attribute__((weak)) int libssh2_session_last_errno(void *session)
  133. {
  134. return 0;
  135. }
  136. __attribute__((weak)) int libssh2_userauth_publickey_fromfile_ex(void *session, const char *user, unsigned int user_len, const char *publickey, const char *privatekey, const char *passphrase)
  137. {
  138. return 0;
  139. }
  140. __attribute__((weak)) int libssh2_userauth_password_ex(void *session, const char *username, unsigned int username_len, const char *password, unsigned int password_len, void *callback)
  141. {
  142. return 0;
  143. }
  144. __attribute__((weak)) void *libssh2_agent_init(void *session)
  145. {
  146. return NULL;
  147. }
  148. __attribute__((weak)) int libssh2_agent_connect(void *agent)
  149. {
  150. return 0;
  151. }
  152. __attribute__((weak)) int libssh2_agent_list_identities(void *agent)
  153. {
  154. return 0;
  155. }
  156. __attribute__((weak)) int libssh2_agent_get_identity(void *agent, void *ext, void *oprev)
  157. {
  158. return 0;
  159. }
  160. __attribute__((weak)) int libssh2_agent_userauth(void *agent, const char *username, void *identity)
  161. {
  162. return 0;
  163. }
  164. __attribute__((weak)) int libssh2_agent_disconnect(void *agent)
  165. {
  166. return 0;
  167. }
  168. __attribute__((weak)) void libssh2_agent_free(void *agent)
  169. {
  170. return;
  171. }
  172. __attribute__((weak)) int libssh2_userauth_keyboard_interactive_ex(void *session, const char *username, unsigned int username_len, void *kbd_callback)
  173. {
  174. return 0;
  175. }
  176. __attribute__((weak)) void *libssh2_sftp_init(int *session)
  177. {
  178. return NULL;
  179. }
  180. __attribute__((weak)) int libssh2_sftp_symlink_ex(void *sftp, const char *path, unsigned int path_len, char *target, unsigned int target_len, int link_type)
  181. {
  182. return 0;
  183. }
  184. __attribute__((weak)) int libssh2_sftp_stat_ex(void *sftp, const char *path, unsigned int path_len, int stat_type, void *attrs)
  185. {
  186. return 0;
  187. }
  188. __attribute__((weak)) int libssh2_sftp_mkdir_ex(void *sftp, const char *path, unsigned int path_len, long mode)
  189. {
  190. return 0;
  191. }
  192. __attribute__((weak)) int libssh2_sftp_rename_ex(void *sftp, const char *source_filename, unsigned int source_filename_len, const char *dest_filename, unsigned int dest_filename_len, long flags)
  193. {
  194. return 0;
  195. }
  196. __attribute__((weak)) int libssh2_sftp_rmdir_ex(void *sftp, const char *path, unsigned int path_len)
  197. {
  198. return 0;
  199. }
  200. __attribute__((weak)) int libssh2_sftp_unlink_ex(void *sftp, const char *filename, unsigned int filename_len)
  201. {
  202. return 0;
  203. }
  204. __attribute__((weak)) void *libssh2_sftp_open_ex(void *sftp, const char *filename, unsigned int filename_len, unsigned long flags, long mode, int open_type)
  205. {
  206. return NULL;
  207. }
  208. __attribute__((weak)) int libssh2_sftp_close_handle(void *hnd)
  209. {
  210. return 0;
  211. }
  212. __attribute__((weak)) int libssh2_sftp_shutdown(void *sftp)
  213. {
  214. return 0;
  215. }
  216. __attribute__((weak)) void libssh2_sftp_seek64(void *handle, unsigned long long offset)
  217. {
  218. return;
  219. }
  220. __attribute__((weak)) void libssh2_exit(void)
  221. {
  222. return;
  223. }
  224. __attribute__((weak)) void libssh2_init(void)
  225. {
  226. return;
  227. }
  228. __attribute__((weak)) int libssh2_knownhost_readfile(void *hosts, const char *filename, int type)
  229. {
  230. return 0;
  231. }
  232. __attribute__((weak)) int libssh2_session_free(void *session)
  233. {
  234. return 0;
  235. }
  236. __attribute__((weak)) void *libssh2_knownhost_init(void *session)
  237. {
  238. return NULL;
  239. }
  240. __attribute__((weak)) unsigned long libssh2_sftp_last_error(void *sftp)
  241. {
  242. return 0;
  243. }
  244. __attribute__((weak)) int libssh2_sftp_statvfs(void *sftp, const char *path, size_t path_len, void *st)
  245. {
  246. return 0;
  247. }
  248. __attribute__((weak)) int libssh2_sftp_readdir_ex(void *hnd, char *buffer, size_t buffer_maxlen, char *longentry, size_t longentry_maxlen, void *attrs)
  249. {
  250. return 0;
  251. }
  252. __attribute__((weak)) void *libssh2_scp_send64(void *session, const char *path, int mode, long long size, time_t mtime, time_t atime)
  253. {
  254. return NULL;
  255. }
  256. __attribute__((weak)) void *libssh2_scp_recv2(void *session, const char *path, void *sb)
  257. {
  258. return NULL;
  259. };
  260. __attribute__((weak)) int libssh2_channel_send_eof(void *channel)
  261. {
  262. return 0;
  263. }
  264. __attribute__((weak)) int libssh2_channel_wait_eof(void *channel)
  265. {
  266. return 0;
  267. }
  268. __attribute__((weak)) int libssh2_channel_wait_closed(void *channel)
  269. {
  270. return 0;
  271. }
  272. __attribute__((weak)) int libssh2_channel_free(void *channel)
  273. {
  274. return 0;
  275. }
  276. __attribute__((weak)) int libssh2_session_disconnect_ex(void *session, int reason, const char *desc, const char *lang)
  277. {
  278. return 0;
  279. }
  280. __attribute__((weak)) void libssh2_knownhost_free(void *hosts)
  281. {
  282. return;
  283. }
  284. __attribute__((weak)) void *libssh2_session_init_ex(void *my_libssh2_malloc, void *my_libssh2_free, void *my_libssh2_realloc, void *abstract)
  285. {
  286. return NULL;
  287. }
  288. __attribute__((weak)) void *libssh2_session_callback_set(void * session, int cbtype, void *callback)
  289. {
  290. return NULL;
  291. }
  292. __attribute__((weak)) int libssh2_session_flag(void * session, int flag, int value)
  293. {
  294. return 0;
  295. }
  296. #endif
  297. #if !IP_NAT
  298. __attribute__((weak)) bool get_nat_enabled(uint8_t nSimId, uint8_t nCid)
  299. {
  300. return false;
  301. }
  302. __attribute__((weak)) struct netif* netif_get_by_cid_type(u8_t sim_cid, u8_t type)
  303. {
  304. return NULL;
  305. }
  306. #endif
  307. //UNIOT_AT
  308. #ifndef CONFIG_QUEC_PROJECT_FEATURE_UNIOT_AT
  309. __attribute__((weak)) void at_mqtt_uniyfkeyinfom_cmd_func(ql_at_cmd_t *cmd)
  310. {
  311. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  312. return ;
  313. }
  314. __attribute__((weak)) void at_mqtt_unidelfkeyinfom_cmd_func(ql_at_cmd_t *cmd)
  315. {
  316. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  317. return ;
  318. }
  319. __attribute__((weak)) void at_mqtt_uniyfkeyinfo_cmd_func(atCommand_t *cmd)
  320. {
  321. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  322. return ;
  323. }
  324. __attribute__((weak)) void at_mqtt_unidelfkeyinfo_cmd_func(atCommand_t *cmd)
  325. {
  326. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  327. return ;
  328. }
  329. __attribute__((weak)) void at_mqtt_unimqttconn_cmd_func(atCommand_t *cmd)
  330. {
  331. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  332. return ;
  333. }
  334. __attribute__((weak)) void at_mqtt_unimqttdiscon_cmd_func(atCommand_t *cmd)
  335. {
  336. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  337. return ;
  338. }
  339. __attribute__((weak)) void at_mqtt_unimqttstate_cmd_func(atCommand_t *cmd)
  340. {
  341. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  342. return ;
  343. }
  344. __attribute__((weak)) void at_mqtt_unimqttsub_cmd_func(atCommand_t *cmd)
  345. {
  346. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  347. return ;
  348. }
  349. __attribute__((weak)) void at_mqtt_unimqttpub_cmd_func(atCommand_t *cmd)
  350. {
  351. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  352. return ;
  353. }
  354. __attribute__((weak)) void at_mqtt_unimqttbind_cmd_func(atCommand_t *cmd)
  355. {
  356. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  357. return ;
  358. }
  359. __attribute__((weak)) void at_mqtt_unimqttbindsub_cmd_func(atCommand_t *cmd)
  360. {
  361. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  362. return ;
  363. }
  364. __attribute__((weak)) void at_mqtt_unimqttshadowsub_cmd_func(atCommand_t *cmd)
  365. {
  366. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  367. return ;
  368. }
  369. __attribute__((weak)) void at_mqtt_unimqttshadowget_cmd_func(atCommand_t *cmd)
  370. {
  371. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  372. return ;
  373. }
  374. __attribute__((weak)) void at_mqtt_unimqttshadowpub_cmd_func(atCommand_t *cmd)
  375. {
  376. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  377. return ;
  378. }
  379. __attribute__((weak)) void at_mqtt_unipsmset_cmd_func(atCommand_t *cmd)
  380. {
  381. quec_atResp(cmd->engine, ATCI_RESULT_CODE_CME_ERROR, CMD_RC_NOTSUPPORT, NULL, 1);
  382. return ;
  383. }
  384. #endif /*CONFIG_QUEC_PROJECT_FEATURE_UNIOT_AT*/