From 4f99859d37800baf2f87b3869f1c0e1903e3467a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 1 Apr 2010 09:13:44 -0700 Subject: Remove useless pppcp_protocol_data structure --- gatchat/ppp_net.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'gatchat/ppp_net.c') 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; -- cgit v1.2.3