diff options
author | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2010-10-04 11:38:00 +0200 |
---|---|---|
committer | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2010-10-04 11:38:00 +0200 |
commit | 4c8978d341731e5aa49bc877214d145bfde0bc20 (patch) | |
tree | 5f979afd2cb23e820b949134369cf996b7e07a7a | |
parent | 3e4740e94d5151783085b16df6d76692cfa9cb5f (diff) | |
download | MAC-Telnet-4c8978d341731e5aa49bc877214d145bfde0bc20.tar.gz MAC-Telnet-4c8978d341731e5aa49bc877214d145bfde0bc20.zip |
Minior code cleanup
-rw-r--r-- | mactelnet.h | 3 | ||||
-rw-r--r-- | 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 @@ -21,12 +21,9 @@ #include <arpa/inet.h> #include <netinet/ether.h> #include <string.h> +#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; |