OpFlex Framework  1.3.0
Opflex Framework Object

Main interface to the OpFlex framework. More...

Typedefs

typedef ofobj_p offramework_p
 A pointer to an OF framework object.
 
typedef ofobj_p ofpeerstatuslistener_p
 A pointer to peer status listener object.
 

Functions

ofstatus offramework_create (offramework_p *framework)
 Create a new OF framework instance. More...
 
ofstatus offramework_destroy (offramework_p *framework)
 Destroy a OF Framework instance, and zero the pointer. More...
 
ofstatus offramework_set_model (offramework_p framework, ofmetadata_p metadata)
 Add the given model metadata to the managed object database. More...
 
ofstatus offramework_set_opflex_identity (offramework_p framework, const char *name, const char *domain)
 Set the opflex identity information for this framework instance. More...
 
ofstatus offramework_start (offramework_p framework)
 Start the framework. More...
 
ofstatus offramework_stop (offramework_p framework)
 Cleanly stop the framework. More...
 
ofstatus offramework_add_peer (offramework_p framework, const char *hostname, int port)
 Add an OpFlex peer. More...
 
ofstatus offramework_register_peerstatuslistener (offramework_p framework, ofpeerstatuslistener_p obj)
 register to listen to opflex peer connection status and health More...
 

Detailed Description

Main interface to the OpFlex framework.

Function Documentation

ofstatus offramework_add_peer ( offramework_p  framework,
const char *  hostname,
int  port 
)

Add an OpFlex peer.

If the framework is started, this will immediately initiate a new connection asynchronously.

When connecting to the peer, that peer may provide an additional list of peers to connect to, which will be automatically added as peers. If the peer does not include itself in the list, then the framework will disconnect from that peer and add the peers in the list. In this way, it is possible to automatically bootstrap the correct set of peers using a known hostname or IP address or a known, fixed anycast IP address.

Parameters
frameworkthe framework
hostnamethe hostname or IP address to connect to
portthe TCP port to connect on
Returns
a status code
ofstatus offramework_create ( offramework_p framework)

Create a new OF framework instance.

You must eventually call offramework_destroy() on the returned object.

Parameters
frameworka pointer to memory that will receive the pointer to the newly-allocated object.
Returns
a status code
ofstatus offramework_destroy ( offramework_p framework)

Destroy a OF Framework instance, and zero the pointer.

Parameters
frameworka pointer to memory containing the OF framework pointer.
Returns
a status code
ofstatus offramework_register_peerstatuslistener ( offramework_p  framework,
ofpeerstatuslistener_p  obj 
)

register to listen to opflex peer connection status and health

Parameters
frameworkthe framework
objThe peer status listener object created with ofpeerstatuslistener_cr eate.
Returns
a status code
ofstatus offramework_set_model ( offramework_p  framework,
ofmetadata_p  metadata 
)

Add the given model metadata to the managed object database.

Must be called before offramework_start().

Parameters
frameworkthe framework
metadatathe model metadata to set
Returns
a status code
ofstatus offramework_set_opflex_identity ( offramework_p  framework,
const char *  name,
const char *  domain 
)

Set the opflex identity information for this framework instance.

Parameters
frameworkthe framework
namethe unique name for this opflex component within the policy domain
domainthe globally unique name for this policy domain
Returns
a status code
ofstatus offramework_start ( offramework_p  framework)

Start the framework.

This will start all the framework threads and attempt to connect to configured OpFlex peers.

Parameters
frameworkthe framework
Returns
a status code
ofstatus offramework_stop ( offramework_p  framework)

Cleanly stop the framework.

Parameters
frameworkthe framework
Returns
a status code