source: ogServer-Git/src/json.h @ 96b02b5

Last change on this file since 96b02b5 was 06af0c2, checked in by OpenGnSys Support Team <soporte-og@…>, 4 years ago

#990 Use client broadcast address on WoL

Some universities have computers in a different subnet where the
ogServer is, but ogServer WoL functionality only supported to send
packet to its own subnets. This commit solves this.

Now ogServer sends two WoL packets per client, one with the broadcast
address of the interface indicated in the config file, the other with
the broadcast address calculated with the address and netmask of the
client.

To ensure that the second WoL works correctly you must configure
correctly the IP and netmask of the clients. Also, you have to configure
the network of your organization to route WoL packet to the correct
subnet.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1#ifndef _OG_JSON_H
2#define _OG_JSON_H
3
4#include <jansson.h>
5#include "schedule.h"
6
7int og_json_parse_string(json_t *element, const char **str);
8int og_json_parse_uint(json_t *element, uint32_t *integer);
9int og_json_parse_bool(json_t *element, bool *value);
10
11#define OG_PARAM_PART_NUMBER                    (1UL << 0)
12#define OG_PARAM_PART_CODE                      (1UL << 1)
13#define OG_PARAM_PART_FILESYSTEM                (1UL << 2)
14#define OG_PARAM_PART_SIZE                      (1UL << 3)
15#define OG_PARAM_PART_FORMAT                    (1UL << 4)
16#define OG_PARAM_PART_DISK                      (1UL << 5)
17#define OG_PARAM_PART_OS                        (1UL << 6)
18#define OG_PARAM_PART_USED_SIZE                 (1UL << 7)
19
20struct og_partition {
21        const char      *disk;
22        const char      *number;
23        const char      *code;
24        const char      *size;
25        const char      *filesystem;
26        const char      *format;
27        const char      *os;
28        const char      *used_size;
29};
30
31#define OG_PARTITION_MAX        4
32
33int og_json_parse_partition(json_t *element, struct og_partition *part,
34                            uint64_t required_flags);
35
36#define OG_CLIENTS_MAX  4096
37
38struct og_sync_params {
39        const char      *sync;
40        const char      *diff;
41        const char      *remove;
42        const char      *compress;
43        const char      *cleanup;
44        const char      *cache;
45        const char      *cleanup_cache;
46        const char      *remove_dst;
47        const char      *diff_id;
48        const char      *diff_name;
49        const char      *path;
50        const char      *method;
51};
52
53struct og_msg_params {
54        const char      *ips_array[OG_CLIENTS_MAX];
55        const char      *mac_array[OG_CLIENTS_MAX];
56        const char      *netmask_array[OG_CLIENTS_MAX];
57        unsigned int    ips_array_len;
58        const char      *wol_type;
59        char            run_cmd[4096];
60        const char      *disk;
61        const char      *partition;
62        const char      *repository;
63        const char      *name;
64        const char      *id;
65        const char      *code;
66        const char      *type;
67        const char      *profile;
68        const char      *cache;
69        const char      *cache_size;
70        bool            echo;
71        struct og_partition     partition_setup[OG_PARTITION_MAX];
72        struct og_sync_params sync_setup;
73        struct og_schedule_time time;
74        const char      *task_id;
75        uint64_t        flags;
76};
77
78#endif
Note: See TracBrowser for help on using the repository browser.