X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=mpath.c;h=ff0b7419fd2be08888b7801956f9967a36b6fbb0;hb=910792c0f373e371af8407c3a3df78a7373452ba;hp=3afe7b763c0a6812a3c8cc8474504831d5600d86;hpb=e1fa918aacc45ae8fcdbc3f5779593cd7d9d86bb;p=thirdparty%2Fiw.git diff --git a/mpath.c b/mpath.c index 3afe7b7..ff0b741 100644 --- a/mpath.c +++ b/mpath.c @@ -23,12 +23,6 @@ enum plink_state { BLOCKED }; -enum plink_actions { - PLINK_ACTION_UNDEFINED, - PLINK_ACTION_OPEN, - PLINK_ACTION_BLOCK, -}; - static int print_mpath_handler(struct nl_msg *msg, void *arg) { @@ -97,9 +91,9 @@ static int print_mpath_handler(struct nl_msg *msg, void *arg) } static int handle_mpath_get(struct nl80211_state *state, - struct nl_cb *cb, struct nl_msg *msg, - int argc, char **argv) + int argc, char **argv, + enum id_input id) { unsigned char dst[ETH_ALEN]; @@ -118,7 +112,7 @@ static int handle_mpath_get(struct nl80211_state *state, NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, dst); - nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpath_handler, NULL); + register_handler(print_mpath_handler, NULL); return 0; nla_put_failure: @@ -132,9 +126,9 @@ COMMAND(mpath, del, "", "Remove the mesh path to the given node."); static int handle_mpath_set(struct nl80211_state *state, - struct nl_cb *cb, struct nl_msg *msg, - int argc, char **argv) + int argc, char **argv, + enum id_input id) { unsigned char dst[ETH_ALEN]; unsigned char next_hop[ETH_ALEN]; @@ -167,7 +161,7 @@ static int handle_mpath_set(struct nl80211_state *state, NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, dst); NLA_PUT(msg, NL80211_ATTR_MPATH_NEXT_HOP, ETH_ALEN, next_hop); - nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpath_handler, NULL); + register_handler(print_mpath_handler, NULL); return 0; nla_put_failure: return -ENOBUFS; @@ -180,13 +174,13 @@ COMMAND(mpath, set, " next_hop ", "Set an existing mesh path's next hop."); static int handle_mpath_dump(struct nl80211_state *state, - struct nl_cb *cb, struct nl_msg *msg, - int argc, char **argv) + int argc, char **argv, + enum id_input id) { printf("DEST ADDR NEXT HOP IFACE\tSN\tMETRIC\tQLEN\t" "EXPTIME\t\tDTIM\tDRET\tFLAGS\n"); - nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpath_handler, NULL); + register_handler(print_mpath_handler, NULL); return 0; } COMMAND(mpath, dump, NULL,