X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Ffail-open.c;h=97fee3eb9279b323f61c5c95fe703d63d66b52ec;hb=9b45d7f5d;hp=cd1db94c52614d1bcab933d805a019191bf4a110;hpb=ee8b231cfc819f518f02b52ceda3cd199546fda2;p=sliver-openvswitch.git diff --git a/ofproto/fail-open.c b/ofproto/fail-open.c index cd1db94c5..97fee3eb9 100644 --- a/ofproto/fail-open.c +++ b/ofproto/fail-open.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ #include "pktbuf.h" #include "poll-loop.h" #include "rconn.h" -#include "status.h" #include "timeval.h" #include "vconn.h" #include "vlog.h" @@ -73,7 +72,6 @@ struct fail_open { struct rconn **controllers; size_t n_controllers; int last_disconn_secs; - struct status_category *ss_cat; long long int next_bogus_packet_in; struct rconn_packet_counter *bogus_packet_counter; }; @@ -298,35 +296,19 @@ fail_open_flushed(struct fail_open *fo) } } -static void -fail_open_status_cb(struct status_reply *sr, void *fo_) -{ - struct fail_open *fo = fo_; - int cur_duration = failure_duration(fo); - int trigger = trigger_duration(fo); - - status_reply_put(sr, "trigger-duration=%d", trigger); - status_reply_put(sr, "current-duration=%d", cur_duration); - status_reply_put(sr, "triggered=%s", - cur_duration >= trigger ? "true" : "false"); -} - -/* Creates and returns a new struct fail_open for 'ofproto', registering switch - * status with 'switch_status'. +/* Creates and returns a new struct fail_open for 'ofproto'. * * The caller should register its set of controllers with * fail_open_set_controllers(). (There should be at least one controller, * otherwise there isn't any point in having the struct fail_open around.) */ struct fail_open * -fail_open_create(struct ofproto *ofproto, struct switch_status *switch_status) +fail_open_create(struct ofproto *ofproto) { struct fail_open *fo = xmalloc(sizeof *fo); fo->ofproto = ofproto; fo->controllers = NULL; fo->n_controllers = 0; fo->last_disconn_secs = 0; - fo->ss_cat = switch_status_register(switch_status, "fail-open", - fail_open_status_cb, fo); fo->next_bogus_packet_in = LLONG_MAX; fo->bogus_packet_counter = rconn_packet_counter_create(); return fo; @@ -355,7 +337,6 @@ fail_open_destroy(struct fail_open *fo) fail_open_recover(fo); free(fo->controllers); /* We don't own the rconns behind fo->controllers. */ - switch_status_unregister(fo->ss_cat); rconn_packet_counter_destroy(fo->bogus_packet_counter); free(fo); }