Browse Source

Remove duplicate definitions

pull/209/head
Felix Pojtinger 5 years ago
parent
commit
fd902173ff
  1. 2
      .gitignore
  2. 28
      sn.c

2
.gitignore

@ -22,4 +22,4 @@ packages/etc/systemd/system/edge-ntopng@.service
packages/etc/systemd/system/edge.service packages/etc/systemd/system/edge.service
packages/etc/systemd/system/edge@.service packages/etc/systemd/system/edge@.service
packages/etc/systemd/system/supernode.service packages/etc/systemd/system/supernode.service
Info.plist *dSYM*

28
sn.c

@ -29,34 +29,6 @@
#define N2N_SN_MGMT_PORT 5645 #define N2N_SN_MGMT_PORT 5645
typedef struct sn_stats {
size_t errors; /* Number of errors encountered. */
size_t reg_super; /* Number of REGISTER_SUPER requests received. */
size_t reg_super_nak; /* Number of REGISTER_SUPER requests declined. */
size_t fwd; /* Number of messages forwarded. */
size_t broadcast; /* Number of messages broadcast to a community. */
time_t last_fwd; /* Time when last message was forwarded. */
time_t last_reg_super; /* Time when last REGISTER_SUPER was received. */
} sn_stats_t;
struct sn_community {
char community[N2N_COMMUNITY_SIZE];
struct peer_info *edges; /* Link list of registered edges. */
UT_hash_handle hh; /* makes this structure hashable */
};
typedef struct n2n_sn {
time_t start_time; /* Used to measure uptime. */
sn_stats_t stats;
int daemon; /* If non-zero then daemonise. */
uint16_t lport; /* Local UDP port to bind to. */
int sock; /* Main socket for UDP traffic with edges. */
int mgmt_sock; /* management socket. */
int lock_communities; /* If true, only loaded communities can be used. */
struct sn_community *communities;
} n2n_sn_t;
#define HASH_FIND_COMMUNITY(head,name,out) HASH_FIND_STR(head,name,out) #define HASH_FIND_COMMUNITY(head,name,out) HASH_FIND_STR(head,name,out)
static int try_forward(n2n_sn_t * sss, static int try_forward(n2n_sn_t * sss,

Loading…
Cancel
Save