From 4c8978d341731e5aa49bc877214d145bfde0bc20 Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Mon, 4 Oct 2010 11:38:00 +0200 Subject: Minior code cleanup --- mactelnet.h | 3 +++ mndp.c | 9 ++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/mactelnet.h b/mactelnet.h index 6dcaaa2..f50b4c6 100644 --- a/mactelnet.h +++ b/mactelnet.h @@ -24,6 +24,9 @@ #define MT_PACKET_LEN 1500 +#define MT_MNDP_PORT 5678 +#define MT_MNDP_MAX_NAME_LENGTH 64 + /* Packet type */ #define MT_PTYPE_SESSIONSTART 0 #define MT_PTYPE_DATA 1 diff --git a/mndp.c b/mndp.c index 1a85f58..7ee5828 100644 --- a/mndp.c +++ b/mndp.c @@ -21,12 +21,9 @@ #include #include #include +#include "mactelnet.h" #include "config.h" -#define MT_PACKET_LEN 1500 -#define MT_MNDP_PORT 5678 -#define MT_MNDP_MAX_NAME_LENGTH 64 - int main(int argc, char **argv) { int sock,result; int optval = 1; @@ -57,9 +54,7 @@ int main(int argc, char **argv) { /* Set the socket to allow sending broadcast packets */ if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &optval, sizeof (optval))==-1) { fprintf(stderr, "Unable to send broadcast packets: Operating in receive only mode.\n"); - } - else - { + } else { /* Request routers identify themselves */ unsigned int message = 0; -- cgit v1.2.3