Move PPP constants where they are used
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 4 Apr 2010 05:32:27 +0000 (22:32 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 4 Apr 2010 05:32:27 +0000 (22:32 -0700)
gatchat/gatppp.c
gatchat/ppp.h
gatchat/ppp_auth.c
gatchat/ppp_cp.c

index bf28aae..8dd41f8 100644 (file)
 #include "gatppp.h"
 #include "ppp.h"
 
-#define BUFFERSZ       DEFAULT_MRU*2
+#define DEFAULT_MRU    1500
+#define DEFAULT_ACCM   0x00000000
+
+#define BUFFERSZ       (DEFAULT_MRU * 2)
+
+#define PPP_ESC                0x7d
+#define PPP_FLAG_SEQ   0x7e
+#define PPP_ADDR_FIELD 0xff
+#define PPP_CTRL       0x03
+
+enum ppp_phase {
+       PPP_DEAD = 0,
+       PPP_ESTABLISHMENT,
+       PPP_AUTHENTICATION,
+       PPP_NETWORK,
+       PPP_TERMINATION,
+};
 
 struct _GAtPPP {
        gint ref_count;
index 90e22ce..f362ffd 100644 (file)
 
 #include "ppp_cp.h"
 
-#define DEFAULT_MRU    1500
-#define DEFAULT_ACCM   0x00000000
-#define PPP_ESC                0x7d
-#define PPP_FLAG_SEQ   0x7e
-#define PPP_ADDR_FIELD 0xff
-#define PPP_CTRL       0x03
 #define LCP_PROTOCOL   0xc021
 #define CHAP_PROTOCOL  0xc223
 #define IPCP_PROTO     0x8021
 #define PPP_IP_PROTO   0x0021
-#define PPP_HEADROOM   2
-#define HDLC_HEADROOM  3
-#define HDLC_TAIL      3
-#define MD5            5
-
-enum ppp_phase {
-       PPP_DEAD = 0,
-       PPP_ESTABLISHMENT,
-       PPP_AUTHENTICATION,
-       PPP_NETWORK,
-       PPP_TERMINATION,
-};
 
 enum ppp_event {
        PPP_UP = 1,
index e04f708..3f69fa3 100644 (file)
@@ -35,6 +35,8 @@
 #include "gatppp.h"
 #include "ppp.h"
 
+#define MD5    5
+
 struct chap_header {
        guint8 code;
        guint8 identifier;
index 46c62c1..63d724d 100644 (file)
@@ -46,6 +46,8 @@ static const char *pppcp_state_strings[] =
        g_free(str); \
 } while (0);
 
+#define PPP_HEADROOM   2
+
 #define pppcp_to_ppp_packet(p) \
        (((guint8 *) p) - PPP_HEADROOM)