OpenSDN source code
segment_health_check.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #ifndef vnsw_agent_segment_health_check_hpp
7 #define vnsw_agent_segment_health_check_hpp
8 
9 #include "diag/diag.h"
10 #include "diag/diag_types.h"
11 #include "pkt/control_interface.h"
12 
14 
16 public:
17  enum Status {
19  FAILURE
20  };
21  static const int kBufferSize = 1024;
22 
25  virtual ~SegmentHealthCheckPkt();
26 
27  virtual void SendRequest();
28  void RequestTimedOut(uint32_t seqno);
29  virtual void HandleReply(DiagPktHandler *handler);
30  virtual void Retry();
31  virtual bool IsDone() {
32  /* Keep sending health-check packets until this object is removed.
33  * We remove this object when an explicit delete request is received
34  */
35  return false;
36  }
37  virtual bool ResendOnTimerExpiry() { return false; }
39  service_ = svc;
40  }
41  void StopDelayTimer();
43 
44 private:
45  void FillDiagHeader(AgentDiagPktData *data) const;
46  void Notify(Status status);
47  bool RetryHandler();
48  int GetTimeout(const HealthCheckInstanceService *svc) const;
49  int GetDelay(const HealthCheckInstanceService *svc) const;
50 
53  int delay_msecs_; //delay/interval in milliseconds
55 };
56 
57 #endif
Definition: diag.h:22
DiagTable * diag_table() const
Definition: diag.h:49
virtual bool ResendOnTimerExpiry()
int GetDelay(const HealthCheckInstanceService *svc) const
void FillDiagHeader(AgentDiagPktData *data) const
HealthCheckInstanceService * service_
int GetTimeout(const HealthCheckInstanceService *svc) const
void Notify(Status status)
static const int kBufferSize
void RequestTimedOut(uint32_t seqno)
void set_service(HealthCheckInstanceService *svc)
SegmentHealthCheckPkt(HealthCheckInstanceService *service, DiagTable *diag_table)
void UpdateService(HealthCheckInstanceService *service)
virtual void HandleReply(DiagPktHandler *handler)
Definition: timer.h:58