OpFlex Framework 1.7.0
ofpeerstatuslistener_c.h
Go to the documentation of this file.
1/* -*- C -*-; c-basic-offset: 4; indent-tabs-mode: nil */
6/*
7 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
8 *
9 * This program and the accompanying materials are made available under the
10 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
11 * and is available at http://www.eclipse.org/legal/epl-v10.html
12 */
13#include "ofcore_c.h"
14
15#ifndef OPFLEX_C_OFPEERSTATUSLISTENER_H
16#define OPFLEX_C_OFPEERSTATUSLISTENER_H
17
24
35
41
45#define OF_PEERSTATUS_DISCONNECTED 0
49#define OF_PEERSTATUS_CONNECTING 1
53#define OF_PEERSTATUS_CONNECTED 2
57#define OF_PEERSTATUS_READY 3
61#define OF_PEERSTATUS_CLOSING 4
65#define OF_PEERSTATUS_ERROR -1
66
74
78#define OF_POOLHEALTH_DOWN 0
82#define OF_POOLHEALTH_DEGRADED 1
86#define OF_POOLHEALTH_HEALTHY 2
90#define OF_POOLHEALTH_ERROR -1
91
95
100
101#ifdef __cplusplus
102extern "C" {
103#endif
104
116 typedef void (*ofpeerstatus_peer_p)(void* user_data,
117 const char *peerhostname,
118 int port,
119 int status);
120
130 typedef void (*ofpeerstatus_health_p)(void* user_data,
131 int health);
132
147 ofpeerstatus_peer_p peer_callback,
148 ofpeerstatus_health_p health_callback,
149 /* out */ ofpeerstatuslistener_p *obj);
150
160
161#ifdef __cplusplus
162} /* extern "C" */
163#endif
164
168
169#endif /* OPFLEX_C_OFPEERSTATUSLISTENER_H */
int ofstatus
An opflex status code.
Definition ofcore_c.h:84
void * ofobj_p
Base type for all OpFlex object pointers.
Definition ofcore_c.h:89
ofobj_p ofpeerstatuslistener_p
A pointer to peer status listener object.
Definition offramework_c.h:59
void(* ofpeerstatus_peer_p)(void *user_data, const char *peerhostname, int port, int status)
A function pointer to receive peer status updates.
Definition ofpeerstatuslistener_c.h:116
ofstatus ofpeerstatuslistener_create(void *user_data, ofpeerstatus_peer_p peer_callback, ofpeerstatus_health_p health_callback, ofpeerstatuslistener_p *obj)
Creates peer status listener object.
ofstatus ofpeerstatuslistener_destroy(ofpeerstatuslistener_p *obj)
Destroy the peer status listener object, and zero the pointer.
void(* ofpeerstatus_health_p)(void *user_data, int health)
A function pointer to recieve connection pool health status updates.
Definition ofpeerstatuslistener_c.h:130
C wrapper core defininitions.