Lines Matching refs:fsm
25 return ppp_fsm_input(&ctx->ipcp.fsm, PPP_IPCP, pkt); in ipcp_handle()
140 static struct net_pkt *ipcp_config_info_add(struct ppp_fsm *fsm) in ipcp_config_info_add() argument
142 return ppp_my_options_add(fsm, 3 * IP_ADDRESS_OPTION_LEN); in ipcp_config_info_add()
151 static int ipcp_dns_address_parse(struct ppp_fsm *fsm, struct net_pkt *pkt, in ipcp_dns_address_parse() argument
176 static int ipcp_ip_address_parse(struct ppp_fsm *fsm, struct net_pkt *pkt, in ipcp_ip_address_parse() argument
213 static int ipcp_server_nak_ip_address(struct ppp_fsm *fsm, in ipcp_server_nak_ip_address() argument
217 CONTAINER_OF(fsm, struct ppp_context, ipcp.fsm); in ipcp_server_nak_ip_address()
227 static int ipcp_server_nak_dns1_address(struct ppp_fsm *fsm, in ipcp_server_nak_dns1_address() argument
232 CONTAINER_OF(fsm, struct ppp_context, ipcp.fsm); in ipcp_server_nak_dns1_address()
240 static int ipcp_server_nak_dns2_address(struct ppp_fsm *fsm, in ipcp_server_nak_dns2_address() argument
245 CONTAINER_OF(fsm, struct ppp_context, ipcp.fsm); in ipcp_server_nak_dns2_address()
269 static int ipcp_config_info_req(struct ppp_fsm *fsm, in ipcp_config_info_req() argument
275 CONTAINER_OF(fsm, struct ppp_context, ipcp.fsm); in ipcp_config_info_req()
281 ret = ppp_config_info_req(fsm, pkt, length, ret_pkt, PPP_IPCP, in ipcp_config_info_req()
292 fsm->name, fsm, "peer "); in ipcp_config_info_req()
308 static void ipcp_set_dns_servers(struct ppp_fsm *fsm) in ipcp_set_dns_servers() argument
311 struct ppp_context *ctx = CONTAINER_OF(fsm, struct ppp_context, in ipcp_set_dns_servers()
312 ipcp.fsm); in ipcp_set_dns_servers()
349 static int ipcp_config_info_nack(struct ppp_fsm *fsm, in ipcp_config_info_nack() argument
354 struct ppp_context *ctx = CONTAINER_OF(fsm, struct ppp_context, in ipcp_config_info_nack()
355 ipcp.fsm); in ipcp_config_info_nack()
358 ret = ppp_my_options_parse_conf_nak(fsm, pkt, length); in ipcp_config_info_nack()
367 ipcp_set_dns_servers(fsm); in ipcp_config_info_nack()
374 ppp_fsm_lower_down(&ctx->ipcp.fsm); in ipcp_lower_down()
379 ppp_fsm_lower_up(&ctx->ipcp.fsm); in ipcp_lower_up()
384 ppp_fsm_open(&ctx->ipcp.fsm); in ipcp_open()
389 ppp_fsm_close(&ctx->ipcp.fsm, reason); in ipcp_close()
392 static void ipcp_up(struct ppp_fsm *fsm) in ipcp_up() argument
394 struct ppp_context *ctx = CONTAINER_OF(fsm, struct ppp_context, in ipcp_up()
395 ipcp.fsm); in ipcp_up()
421 NET_DBG("[%s/%p] Current state %s (%d)", fsm->name, fsm, in ipcp_up()
422 ppp_state_str(fsm->state), fsm->state); in ipcp_up()
425 static void ipcp_down(struct ppp_fsm *fsm) in ipcp_down() argument
427 struct ppp_context *ctx = CONTAINER_OF(fsm, struct ppp_context, in ipcp_down()
428 ipcp.fsm); in ipcp_down()
451 static void ipcp_finished(struct ppp_fsm *fsm) in ipcp_finished() argument
453 struct ppp_context *ctx = CONTAINER_OF(fsm, struct ppp_context, in ipcp_finished()
454 ipcp.fsm); in ipcp_finished()
465 static void ipcp_proto_reject(struct ppp_fsm *fsm) in ipcp_proto_reject() argument
467 ppp_fsm_lower_down(fsm); in ipcp_proto_reject()
473 &ctx->ipcp.fsm); in ipcp_init()
475 memset(&ctx->ipcp.fsm, 0, sizeof(ctx->ipcp.fsm)); in ipcp_init()
477 ppp_fsm_init(&ctx->ipcp.fsm, PPP_IPCP); in ipcp_init()
479 ppp_fsm_name_set(&ctx->ipcp.fsm, ppp_proto2str(PPP_IPCP)); in ipcp_init()
481 ctx->ipcp.fsm.my_options.info = ipcp_my_options; in ipcp_init()
482 ctx->ipcp.fsm.my_options.data = ctx->ipcp.my_options_data; in ipcp_init()
483 ctx->ipcp.fsm.my_options.count = ARRAY_SIZE(ipcp_my_options); in ipcp_init()
485 ctx->ipcp.fsm.cb.up = ipcp_up; in ipcp_init()
486 ctx->ipcp.fsm.cb.down = ipcp_down; in ipcp_init()
487 ctx->ipcp.fsm.cb.finished = ipcp_finished; in ipcp_init()
488 ctx->ipcp.fsm.cb.proto_reject = ipcp_proto_reject; in ipcp_init()
489 ctx->ipcp.fsm.cb.config_info_add = ipcp_config_info_add; in ipcp_init()
490 ctx->ipcp.fsm.cb.config_info_req = ipcp_config_info_req; in ipcp_init()
491 ctx->ipcp.fsm.cb.config_info_nack = ipcp_config_info_nack; in ipcp_init()
492 ctx->ipcp.fsm.cb.config_info_rej = ppp_my_options_parse_conf_rej; in ipcp_init()