Browse Source

Merge pull request #9 from foosinn/master

fix spaces on iptables-save
pull/11/head
nwerensteijn 8 years ago committed by GitHub
parent
commit
bf2bc8320e
  1. 9
      src/libxt_TS3INIT_SET_COOKIE.c
  2. 8
      src/libxt_ts3init.c
  3. 7
      src/libxt_ts3init_get_cookie.c
  4. 11
      src/libxt_ts3init_get_puzzle.c

9
src/libxt_TS3INIT_SET_COOKIE.c

@ -85,27 +85,26 @@ static void ts3init_set_cookie_tg_save(const void *ip, const struct xt_entry_tar @@ -85,27 +85,26 @@ static void ts3init_set_cookie_tg_save(const void *ip, const struct xt_entry_tar
const struct xt_ts3init_set_cookie_tginfo *info = (const void *)target->data;
if (info->specific_options & TARGET_SET_COOKIE_ZERO_RANDOM_SEQUENCE)
{
printf("--zero-random-sequence ");
printf(" --zero-random-sequence");
}
if (info->specific_options & TARGET_SET_COOKIE_RANDOM_SEED_FROM_ARGUMENT)
{
printf("--random-seed ");
printf(" --random-seed ");
for (i = 0; i < RANDOM_SEED_LEN; i++)
{
printf("%02X", info->random_seed[i]);
}
printf(" ");
}
if (info->specific_options & TARGET_SET_COOKIE_RANDOM_SEED_FROM_FILE)
{
printf("--random-seed-file \"%s\" ", info->random_seed_path);
printf(" --random-seed-file \"%s\"", info->random_seed_path);
}
}
static void ts3init_set_cookie_tg_print(const void *ip, const struct xt_entry_target *target,
int numeric)
{
printf(" -j TS3INIT_SET_COOKIE ");
printf(" -j TS3INIT_SET_COOKIE");
ts3init_set_cookie_tg_save(ip, target);
}

8
src/libxt_ts3init.c

@ -83,22 +83,22 @@ static void ts3init_save(const void *ip, const struct xt_entry_match *match) @@ -83,22 +83,22 @@ static void ts3init_save(const void *ip, const struct xt_entry_match *match)
const struct xt_ts3init_mtinfo *info = (const void *)match->data;
if (info->specific_options & CHK_TS3INIT_CLIENT)
{
printf("--client ");
printf(" --client");
}
if (info->specific_options & CHK_TS3INIT_SERVER)
{
printf("--server ");
printf(" --server");
}
if (info->specific_options & CHK_TS3INIT_COMMAND)
{
printf("--command %i ", (int)info->command);
printf(" --command %i", (int)info->command);
}
}
static void ts3init_print(const void *ip, const struct xt_entry_match *match,
int numeric)
{
printf(" -m ts3init ");
printf(" -m ts3init");
ts3init_save(ip, match);
}

7
src/libxt_ts3init_get_cookie.c

@ -79,18 +79,18 @@ static void ts3init_get_cookie_save(const void *ip, const struct xt_entry_match @@ -79,18 +79,18 @@ static void ts3init_get_cookie_save(const void *ip, const struct xt_entry_match
const struct xt_ts3init_get_cookie_mtinfo *info = (const void *)match->data;
if (info->common_options & CHK_COMMON_CLIENT_VERSION)
{
printf("--min-client %u ", info->min_client_version + CLIENT_VERSION_OFFSET);
printf(" --min-client %u", info->min_client_version + CLIENT_VERSION_OFFSET);
}
if (info->specific_options & CHK_GET_COOKIE_CHECK_TIMESTAMP)
{
printf("--check-time %u ", info->max_utc_offset);
printf(" --check-time %u", info->max_utc_offset);
}
}
static void ts3init_get_cookie_print(const void *ip, const struct xt_entry_match *match,
int numeric)
{
printf(" -m ts3init_get_cookie ");
printf(" -m ts3init_get_cookie");
ts3init_get_cookie_save(ip, match);
}
@ -129,4 +129,3 @@ static __attribute__((constructor)) void ts3init_mt_ldr(void) @@ -129,4 +129,3 @@ static __attribute__((constructor)) void ts3init_mt_ldr(void)
{
xtables_register_matches(ts3init_mt_reg, ARRAY_SIZE(ts3init_mt_reg));
}

11
src/libxt_ts3init_get_puzzle.c

@ -103,31 +103,30 @@ static void ts3init_get_puzzle_save(const void *ip, const struct xt_entry_match @@ -103,31 +103,30 @@ static void ts3init_get_puzzle_save(const void *ip, const struct xt_entry_match
const struct xt_ts3init_get_puzzle_mtinfo *info = (const void *)match->data;
if (info->common_options & CHK_COMMON_CLIENT_VERSION)
{
printf("--min-client %u ", info->min_client_version + CLIENT_VERSION_OFFSET);
printf(" --min-client %u", info->min_client_version + CLIENT_VERSION_OFFSET);
}
if (info->specific_options & CHK_GET_PUZZLE_CHECK_COOKIE)
{
printf("--check-cookie ");
printf(" --check-cookie");
}
if (info->specific_options & CHK_GET_PUZZLE_RANDOM_SEED_FROM_ARGUMENT)
{
printf("--random-seed ");
printf(" --random-seed ");
for (i = 0; i < RANDOM_SEED_LEN; i++)
{
printf("%02X", info->random_seed[i]);
}
printf(" ");
}
if (info->specific_options & CHK_GET_PUZZLE_RANDOM_SEED_FROM_FILE)
{
printf("--random-seed-file \"%s\" ", info->random_seed_path);
printf(" --random-seed-file \"%s\"", info->random_seed_path);
}
}
static void ts3init_get_puzzle_print(const void *ip, const struct xt_entry_match *match,
int numeric)
{
printf(" -m ts3init_get_puzzle ");
printf(" -m ts3init_get_puzzle");
ts3init_get_puzzle_save(ip, match);
}

Loading…
Cancel
Save