aboutsummaryrefslogtreecommitdiffstats
path: root/src/whack
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2009-05-24 20:14:13 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2009-05-24 20:14:13 +0200
commitc0bc85c5b650aec7d6ec5fb948a33016f0fd82ec (patch)
tree3056114db26ce315a81a04ce5d875c908d3400d0 /src/whack
parent90df644ed65d8887ba5b71f462164dbb1f792577 (diff)
downloadstrongswan-c0bc85c5b650aec7d6ec5fb948a33016f0fd82ec.tar.bz2
strongswan-c0bc85c5b650aec7d6ec5fb948a33016f0fd82ec.tar.xz
cosmetics
Diffstat (limited to 'src/whack')
-rw-r--r--src/whack/whack.c38
1 files changed, 13 insertions, 25 deletions
diff --git a/src/whack/whack.c b/src/whack/whack.c
index 0d7a292b7..c7998a104 100644
--- a/src/whack/whack.c
+++ b/src/whack/whack.c
@@ -34,8 +34,7 @@
#include "defs.h"
#include "whack.h"
-static void
-help(void)
+static void help(void)
{
fprintf(stderr
, "Usage:\n\n"
@@ -238,8 +237,7 @@ static const char *label = NULL; /* --label operand, saved for diagnostic
static const char *name = NULL; /* --name operand, saved for diagnostics */
/* print a string as a diagnostic, then exit whack unhappily */
-static void
-diag(const char *mess)
+static void diag(const char *mess)
{
if (mess != NULL)
{
@@ -255,8 +253,7 @@ diag(const char *mess)
}
/* conditially calls diag; prints second arg, if non-NULL, as quoted string */
-static void
-diagq(err_t ugh, const char *this)
+static void diagq(err_t ugh, const char *this)
{
if (ugh != NULL)
{
@@ -652,12 +649,9 @@ struct sockaddr_un ctl_addr = { AF_UNIX, DEFAULT_CTLBASE CTL_SUFFIX };
/* helper variables and function to encode strings from whack message */
-static char
- *next_str,
- *str_roof;
+static char *next_str,*str_roof;
-static bool
-pack_str(char **p)
+static bool pack_str(char **p)
{
const char *s = *p == NULL? "" : *p; /* note: NULL becomes ""! */
size_t len = strlen(s) + 1;
@@ -675,9 +669,8 @@ pack_str(char **p)
}
}
-static void
-check_life_time(time_t life, time_t limit, const char *which
-, const whack_message_t *msg)
+static void check_life_time(time_t life, time_t limit, const char *which,
+ const whack_message_t *msg)
{
time_t mint = msg->sa_rekey_margin * (100 + msg->sa_rekey_fuzz) / 100;
@@ -706,8 +699,7 @@ check_life_time(time_t life, time_t limit, const char *which
}
}
-static void
-clear_end(whack_end_t *e)
+static void clear_end(whack_end_t *e)
{
zero(e);
e->id = NULL;
@@ -717,8 +709,7 @@ clear_end(whack_end_t *e)
e->host_port = IKE_UDP_PORT;
}
-static void
-update_ports(whack_message_t *m)
+static void update_ports(whack_message_t *m)
{
int port;
@@ -734,9 +725,8 @@ update_ports(whack_message_t *m)
}
}
-static void
-check_end(whack_end_t *this, whack_end_t *that
-, bool default_nexthop, sa_family_t caf, sa_family_t taf)
+static void check_end(whack_end_t *this, whack_end_t *that,
+ bool default_nexthop, sa_family_t caf, sa_family_t taf)
{
if (caf != addrtypeof(&this->host_addr))
diag("address family of host inconsistent");
@@ -774,8 +764,7 @@ check_end(whack_end_t *this, whack_end_t *that
diag("the protocol for leftprotoport and rightprotoport must be the same");
}
-static void
-get_secret(int sock)
+static void get_secret(int sock)
{
const char *buf, *secret;
int len;
@@ -798,8 +787,7 @@ get_secret(int sock)
/* This is a hack for initiating ISAKMP exchanges. */
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
whack_message_t msg;
char esp_buf[256]; /* uses snprintf */