|
OpFlex Framework 1.7.0
|
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. | |
| ofstatus | offramework_destroy (offramework_p *framework) |
| Destroy a OF Framework instance, and zero the pointer. | |
| ofstatus | offramework_set_model (offramework_p framework, ofmetadata_p metadata) |
| Add the given model metadata to the managed object database. | |
| ofstatus | offramework_set_opflex_identity (offramework_p framework, const char *name, const char *domain) |
| Set the opflex identity information for this framework instance. | |
| ofstatus | offramework_start (offramework_p framework) |
| Start the framework. | |
| ofstatus | offramework_stop (offramework_p framework) |
| Cleanly stop the framework. | |
| ofstatus | offramework_add_peer (offramework_p framework, const char *hostname, int port) |
| Add an OpFlex peer. | |
| ofstatus | offramework_register_peerstatuslistener (offramework_p framework, ofpeerstatuslistener_p obj) |
| register to listen to opflex peer connection status and health | |
Main interface to the OpFlex framework.
| 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.
| framework | the framework |
| hostname | the hostname or IP address to connect to |
| port | the TCP port to connect on |
| ofstatus offramework_create | ( | offramework_p * | framework | ) |
Create a new OF framework instance.
You must eventually call offramework_destroy() on the returned object.
| framework | a pointer to memory that will receive the pointer to the newly-allocated object. |
| ofstatus offramework_destroy | ( | offramework_p * | framework | ) |
Destroy a OF Framework instance, and zero the pointer.
| framework | a pointer to memory containing the OF framework pointer. |
| ofstatus offramework_register_peerstatuslistener | ( | offramework_p | framework, |
| ofpeerstatuslistener_p | obj ) |
register to listen to opflex peer connection status and health
| framework | the framework |
| obj | The peer status listener object created with ofpeerstatuslistener_create. |
| 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().
| framework | the framework |
| Model Metadata | the model metadata to set |
| ofstatus offramework_set_opflex_identity | ( | offramework_p | framework, |
| const char * | name, | ||
| const char * | domain ) |
Set the opflex identity information for this framework instance.
| framework | the framework |
| name | the unique name for this opflex component within the policy domain |
| domain | the globally unique name for this policy domain |
| ofstatus offramework_start | ( | offramework_p | framework | ) |
Start the framework.
This will start all the framework threads and attempt to connect to configured OpFlex peers.
| framework | the framework |
| ofstatus offramework_stop | ( | offramework_p | framework | ) |
Cleanly stop the framework.
| framework | the framework |