summaryrefslogtreecommitdiffstats
path: root/gatchat/ppp_net.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-04-01 09:13:44 -0700
committerMarcel Holtmann <marcel@holtmann.org>2010-04-01 09:13:44 -0700
commit4f99859d37800baf2f87b3869f1c0e1903e3467a (patch)
tree1ac2ea8ec078cce79d6216e404eaa45e828a6ee6 /gatchat/ppp_net.c
parent5f0d8493e7f2f60130e34927789b9b4effacb533 (diff)
downloadofono-4f99859d37800baf2f87b3869f1c0e1903e3467a.tar.bz2
Remove useless pppcp_protocol_data structure
Diffstat (limited to 'gatchat/ppp_net.c')
-rw-r--r--gatchat/ppp_net.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/gatchat/ppp_net.c b/gatchat/ppp_net.c
index 03c6ef09..3de6be9c 100644
--- a/gatchat/ppp_net.c
+++ b/gatchat/ppp_net.c
@@ -169,8 +169,6 @@ struct ppp_packet_handler ip_packet_handler = {
(1 << TERMINATE_ACK) | \
(1 << CODE_REJECT))
-#define IPCP_PROTO 0x8021
-
enum ipcp_option_types {
IP_ADDRESSES = 1,
IP_COMPRESSION_PROTO = 2,
@@ -291,8 +289,6 @@ struct pppcp_action ipcp_action = {
.option_process = ipcp_option_process,
};
-static const char ipcp_prefix[] = "ipcp";
-
static const char *ipcp_option_strings[256] = {
[IP_ADDRESSES] = "IP-Addresses (deprecated)",
[IP_COMPRESSION_PROTO] = "IP-Compression-Protocol",
@@ -304,12 +300,6 @@ static const char *ipcp_option_strings[256] = {
[SECONDARY_NBNS_SERVER] = "Secondary NBNS Server Address",
};
-static struct pppcp_protocol_data ipcp_protocol_data = {
- .proto = IPCP_PROTO,
- .prefix = ipcp_prefix,
- .options = ipcp_option_strings,
-};
-
struct ppp_packet_handler ipcp_packet_handler = {
.proto = IPCP_PROTO,
.handler = pppcp_process_packet,
@@ -325,15 +315,16 @@ static struct pppcp_data *ipcp_new(GAtPPP *ppp)
if (!data)
return NULL;
- ipcp_protocol_data.ppp = ppp;
- ipcp_protocol_data.priv = data;
- pppcp = pppcp_new(&ipcp_protocol_data);
+ pppcp = pppcp_new(ppp, IPCP_PROTO);
if (!pppcp) {
g_printerr("Failed to allocate PPPCP struct\n");
g_free(data);
return NULL;
}
pppcp_set_valid_codes(pppcp, IPCP_SUPPORTED_CODES);
+ pppcp->option_strings = ipcp_option_strings;
+ pppcp->prefix = "ipcp";
+ pppcp->priv = data;
/* set the actions */
pppcp->action = &ipcp_action;