1 /******************************************************************************
4 * Copyright (c) 2021, longpanda <admin@ventoy.net>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 3 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef __VENTOY_HTTP_H__
21 #define __VENTOY_HTTP_H__
25 typedef enum PROGRESS_POINT
34 PT_UNXZ_DISK_IMG_FINISH
= PT_LOAD_DISK_IMG
+ 32,
40 PT_WRITE_VENTOY_START
,
41 PT_WRITE_VENTOY_FINISH
= PT_WRITE_VENTOY_START
+ 8,
43 PT_WRITE_STG1_IMG
,//45
47 PT_CHECK_PART2_FINISH
= PT_CHECK_PART2
+ 8,
49 PT_WRITE_PART_TABLE
,//52
55 typedef int (*ventoy_json_callback
)(struct mg_connection
*conn
, VTOY_JSON
*json
);
56 typedef struct JSON_CB
59 ventoy_json_callback callback
;
62 typedef struct ventoy_thread_data
68 uint64_t reserveBytes
;
72 extern int g_vtoy_exfat_disk_fd
;
73 extern uint64_t g_vtoy_exfat_part_size
;
75 int ventoy_http_init(void);
76 void ventoy_http_exit(void);
77 int ventoy_http_start(const char *ip
, const char *port
);
78 int ventoy_http_stop(void);
79 int mkexfat_main(const char *devpath
, int fd
, uint64_t part_sector_count
);
81 #endif /* __VENTOY_HTTP_H__ */