Browse Source

As we are in our own namespace, we can ditch the n2n_ prefix to some definitions

pull/947/head
Hamish Coleman 3 years ago
parent
commit
6e4cf85915
  1. 10
      src/edge_management.c
  2. 10
      src/sn_management.c

10
src/edge_management.c

@ -20,12 +20,12 @@
#include "edge_utils_win32.h"
#define FLAG_WROK 1
typedef struct n2n_mgmt_handler {
typedef struct mgmt_handler {
int flags;
char *cmd;
char *help;
void (*func)(n2n_edge_t *eee, char *udp_buf, struct sockaddr_in sender_sock, enum n2n_mgmt_type type, char *tag, char *argv0, char *argv);
} n2n_mgmt_handler_t;
} mgmt_handler_t;
static void mgmt_error (n2n_edge_t *eee, char *udp_buf, const struct sockaddr_in sender_sock, char *tag, char *msg) {
size_t msg_len;
@ -279,7 +279,7 @@ static void mgmt_unimplemented (n2n_edge_t *eee, char *udp_buf, const struct soc
static void mgmt_help (n2n_edge_t *eee, char *udp_buf, const struct sockaddr_in sender_sock, enum n2n_mgmt_type type, char *tag, char *argv0, char *argv);
n2n_mgmt_handler_t mgmt_handlers[] = {
mgmt_handler_t mgmt_handlers[] = {
{ .cmd = "reload_communities", .flags = FLAG_WROK, .help = "Reserved for supernode", .func = mgmt_unimplemented},
{ .cmd = "stop", .flags = FLAG_WROK, .help = "Gracefully exit edge", .func = mgmt_stop},
@ -295,7 +295,7 @@ n2n_mgmt_handler_t mgmt_handlers[] = {
static void mgmt_help (n2n_edge_t *eee, char *udp_buf, const struct sockaddr_in sender_sock, enum n2n_mgmt_type type, char *tag, char *argv0, char *argv) {
size_t msg_len;
n2n_mgmt_handler_t *handler;
mgmt_handler_t *handler;
/*
* Even though this command is readonly, we deliberately do not check
@ -354,7 +354,7 @@ static void handleMgmtJson (n2n_edge_t *eee, char *udp_buf, const struct sockadd
char *flagstr;
int flags;
char *auth;
n2n_mgmt_handler_t *handler;
mgmt_handler_t *handler;
size_t msg_len;
/* save a copy of the commandline before we reuse the udp_buf */

10
src/sn_management.c

@ -27,12 +27,12 @@
int load_allowed_sn_community (n2n_sn_t *sss); /* defined in sn_utils.c */
#define FLAG_WROK 1
typedef struct n2n_mgmt_handler {
typedef struct mgmt_handler {
int flags;
char *cmd;
char *help;
void (*func)(n2n_sn_t *sss, char *udp_buf, struct sockaddr_in sender_sock, enum n2n_mgmt_type type, char *tag, char *argv0, char *argv);
} n2n_mgmt_handler_t;
} mgmt_handler_t;
static void mgmt_error (n2n_sn_t *sss, char *udp_buf, const struct sockaddr_in sender_sock, char *tag, char *msg) {
size_t msg_len;
@ -263,7 +263,7 @@ static void mgmt_unimplemented (n2n_sn_t *sss, char *udp_buf, const struct socka
static void mgmt_help (n2n_sn_t *sss, char *udp_buf, const struct sockaddr_in sender_sock, enum n2n_mgmt_type type, char *tag, char *argv0, char *argv);
n2n_mgmt_handler_t mgmt_handlers[] = {
mgmt_handler_t mgmt_handlers[] = {
{ .cmd = "supernodes", .help = "Reserved for edge", .func = mgmt_unimplemented},
{ .cmd = "stop", .flags = FLAG_WROK, .help = "Gracefully exit edge", .func = mgmt_stop},
@ -279,7 +279,7 @@ n2n_mgmt_handler_t mgmt_handlers[] = {
static void mgmt_help (n2n_sn_t *sss, char *udp_buf, const struct sockaddr_in sender_sock, enum n2n_mgmt_type type, char *tag, char *argv0, char *argv) {
size_t msg_len;
n2n_mgmt_handler_t *handler;
mgmt_handler_t *handler;
/*
* Even though this command is readonly, we deliberately do not check
@ -338,7 +338,7 @@ static void handleMgmtJson (n2n_sn_t *sss, char *udp_buf, const struct sockaddr_
char *flagstr;
int flags;
char *auth;
n2n_mgmt_handler_t *handler;
mgmt_handler_t *handler;
size_t msg_len;
/* save a copy of the commandline before we reuse the udp_buf */

Loading…
Cancel
Save