1 /* 2 * netifd - network interface daemon 3 * Copyright (C) 2012 Felix Fietkau <nbd@openwrt.org> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 7 * as published by the Free Software Foundation 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 */ 14 #ifndef __NETIFD_PROTO_EXT_H 15 #define __NETIFD_PROTO_EXT_H 16 17 #include "netifd.h" 18 #include "interface.h" 19 #include "interface-ip.h" 20 #include "proto.h" 21 22 enum proto_ext_sm { 23 S_IDLE, 24 S_SETUP, 25 S_SETUP_ABORT, 26 S_TEARDOWN, 27 }; 28 29 struct proto_ext_state { 30 struct interface_proto_state proto; 31 struct blob_attr *config; 32 33 struct uloop_timeout teardown_timeout; 34 35 int checkup_interval; 36 struct uloop_timeout checkup_timeout; 37 38 struct netifd_process script_task; 39 struct netifd_process proto_task; 40 41 enum proto_ext_sm sm; 42 bool proto_task_killed; 43 bool renew_pending; 44 45 int last_error; 46 47 struct list_head deps; 48 }; 49 50 struct proto_ext_dep { 51 struct list_head list; 52 53 struct proto_ext_state *proto; 54 struct interface_user dep; 55 56 union if_addr host; 57 bool v6; 58 bool any; 59 60 char interface[]; 61 }; 62 63 typedef int (*proto_ext_handler_cb)(struct proto_ext_state *state, 64 const char *action, const char *config, 65 char **envp); 66 67 void proto_ext_state_init(struct proto_ext_state *state, 68 struct interface *iface, struct blob_attr *attr, 69 int dir_fd); 70 int proto_ext_run(struct proto_ext_state *state, 71 enum interface_proto_cmd cmd, bool force, 72 proto_ext_handler_cb start_cb); 73 int proto_ext_notify(struct interface_proto_state *proto, struct blob_attr *attr); 74 void proto_ext_free(struct interface_proto_state *proto); 75 76 #endif 77
This page was automatically generated by LXR 0.3.1. • OpenWrt