summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-04-03 22:32:27 -0700
committerMarcel Holtmann <marcel@holtmann.org>2010-04-03 22:32:27 -0700
commitc2fb0a16305bf7156cc4e98b9642f37b0e2342d3 (patch)
treed325665a0c2aba73cdd6d222aec268f2fd2fb934
parent5772ad5d8b736f9a8639ad3c68beae059f04eb31 (diff)
downloadofono-c2fb0a16305bf7156cc4e98b9642f37b0e2342d3.tar.bz2
Move PPP constants where they are used
-rw-r--r--gatchat/gatppp.c18
-rw-r--r--gatchat/ppp.h18
-rw-r--r--gatchat/ppp_auth.c2
-rw-r--r--gatchat/ppp_cp.c2
4 files changed, 21 insertions, 19 deletions
diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index bf28aae6..8dd41f89 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -38,7 +38,23 @@
#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;
diff --git a/gatchat/ppp.h b/gatchat/ppp.h
index 90e22ce2..f362ffdd 100644
--- a/gatchat/ppp.h
+++ b/gatchat/ppp.h
@@ -21,28 +21,10 @@
#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,
diff --git a/gatchat/ppp_auth.c b/gatchat/ppp_auth.c
index e04f708d..3f69fa37 100644
--- a/gatchat/ppp_auth.c
+++ b/gatchat/ppp_auth.c
@@ -35,6 +35,8 @@
#include "gatppp.h"
#include "ppp.h"
+#define MD5 5
+
struct chap_header {
guint8 code;
guint8 identifier;
diff --git a/gatchat/ppp_cp.c b/gatchat/ppp_cp.c
index 46c62c17..63d724d8 100644
--- a/gatchat/ppp_cp.c
+++ b/gatchat/ppp_cp.c
@@ -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)