mirror of git://git.sysmocom.de/ofono
Refactor: Move the state definition to ppp_cp.c
This commit is contained in:
parent
9905245e79
commit
e56710e1da
|
@ -34,10 +34,6 @@
|
||||||
#include "gatppp.h"
|
#include "gatppp.h"
|
||||||
#include "ppp.h"
|
#include "ppp.h"
|
||||||
|
|
||||||
static const char *pppcp_state_strings[] =
|
|
||||||
{"INITIAL", "STARTING", "CLOSED", "STOPPED", "CLOSING", "STOPPING",
|
|
||||||
"REQSENT", "ACKRCVD", "ACKSENT", "OPENED" };
|
|
||||||
|
|
||||||
#define pppcp_trace(p) do { \
|
#define pppcp_trace(p) do { \
|
||||||
char *str = g_strdup_printf("%s: %s: current state %d:%s", \
|
char *str = g_strdup_printf("%s: %s: current state %d:%s", \
|
||||||
p->prefix, __FUNCTION__, \
|
p->prefix, __FUNCTION__, \
|
||||||
|
@ -57,6 +53,23 @@ static const char *pppcp_state_strings[] =
|
||||||
#define MAX_FAILURE 5
|
#define MAX_FAILURE 5
|
||||||
#define CP_HEADER_SZ 4
|
#define CP_HEADER_SZ 4
|
||||||
|
|
||||||
|
enum pppcp_state {
|
||||||
|
INITIAL = 0,
|
||||||
|
STARTING = 1,
|
||||||
|
CLOSED = 2,
|
||||||
|
STOPPED = 3,
|
||||||
|
CLOSING = 4,
|
||||||
|
STOPPING = 5,
|
||||||
|
REQSENT = 6,
|
||||||
|
ACKRCVD = 7,
|
||||||
|
ACKSENT = 8,
|
||||||
|
OPENED = 9,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char *pppcp_state_strings[] =
|
||||||
|
{"INITIAL", "STARTING", "CLOSED", "STOPPED", "CLOSING", "STOPPING",
|
||||||
|
"REQSENT", "ACKRCVD", "ACKSENT", "OPENED" };
|
||||||
|
|
||||||
static void pppcp_packet_free(struct pppcp_packet *packet)
|
static void pppcp_packet_free(struct pppcp_packet *packet)
|
||||||
{
|
{
|
||||||
g_free(pppcp_to_ppp_packet(packet));
|
g_free(pppcp_to_ppp_packet(packet));
|
||||||
|
|
|
@ -54,19 +54,6 @@ enum pppcp_event_type {
|
||||||
RXR,
|
RXR,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum pppcp_state {
|
|
||||||
INITIAL,
|
|
||||||
STARTING,
|
|
||||||
CLOSED,
|
|
||||||
STOPPED,
|
|
||||||
CLOSING,
|
|
||||||
STOPPING,
|
|
||||||
REQSENT,
|
|
||||||
ACKRCVD,
|
|
||||||
ACKSENT,
|
|
||||||
OPENED,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* option format */
|
/* option format */
|
||||||
struct ppp_option {
|
struct ppp_option {
|
||||||
guint8 type;
|
guint8 type;
|
||||||
|
@ -107,7 +94,7 @@ struct pppcp_timer_data {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pppcp_data {
|
struct pppcp_data {
|
||||||
enum pppcp_state state;
|
unsigned char state;
|
||||||
struct pppcp_timer_data config_timer_data;
|
struct pppcp_timer_data config_timer_data;
|
||||||
struct pppcp_timer_data terminate_timer_data;
|
struct pppcp_timer_data terminate_timer_data;
|
||||||
guint max_failure;
|
guint max_failure;
|
||||||
|
|
Loading…
Reference in New Issue