Add common.c
This commit is contained in:
@@ -4,6 +4,7 @@ glorytun_LDADD = $(libsodium_LIBS)
|
|||||||
glorytun_SOURCES = \
|
glorytun_SOURCES = \
|
||||||
src/common.h \
|
src/common.h \
|
||||||
src/common-static.h \
|
src/common-static.h \
|
||||||
|
src/common.c \
|
||||||
src/ip-static.h \
|
src/ip-static.h \
|
||||||
src/main.c \
|
src/main.c \
|
||||||
src/option.c \
|
src/option.c \
|
||||||
|
|||||||
8
src/common.c
Normal file
8
src/common.c
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void gt_not_available (const char *name)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s is not available on your platform!\n", name);
|
||||||
|
}
|
||||||
@@ -24,3 +24,5 @@ struct buffer {
|
|||||||
uint8_t *write;
|
uint8_t *write;
|
||||||
uint8_t *end;
|
uint8_t *end;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void gt_not_available (const char *);
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ struct crypto_ctx {
|
|||||||
|
|
||||||
volatile sig_atomic_t running;
|
volatile sig_atomic_t running;
|
||||||
|
|
||||||
static void gt_not_available (const char *name)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "%s is not available on your platform!\n", name);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int64_t dt_ms (struct timeval *ta, struct timeval *tb)
|
static int64_t dt_ms (struct timeval *ta, struct timeval *tb)
|
||||||
{
|
{
|
||||||
const int64_t s = ta->tv_sec-tb->tv_sec;
|
const int64_t s = ta->tv_sec-tb->tv_sec;
|
||||||
|
|||||||
Reference in New Issue
Block a user