AT&T ECOMP Vendor Event Listener library  0.1
Functions | Variables
evel.c File Reference

Source module isolating the ECOMP Vendor Event Listener (EVEL) API. More...

#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <sys/time.h>
#include <curl/curl.h>
#include "evel.h"
#include "evel_internal.h"
#include "evel_throttle.h"
#include "metadata.h"
Include dependency graph for evel.c:

Go to the source code of this file.

Functions

EVEL_ERR_CODES evel_initialize (const char *const fqdn, int port, const char *const path, const char *const topic, int secure, const char *const username, const char *const password, EVEL_SOURCE_TYPES source_type, const char *const role, int verbosity)
 Library initialization. More...
 
EVEL_ERR_CODES evel_terminate (void)
 Clean up the EVEL library. More...
 
void evel_free_event (void *event)
 Free an event. More...
 

Variables

EVEL_SOURCE_TYPES event_source_type = EVEL_SOURCE_OTHER
 The type of equipment represented by this VNF. More...
 
char * functional_role = NULL
 The Functional Role of the equipment represented by this VNF. More...
 

Detailed Description

Source module isolating the ECOMP Vendor Event Listener (EVEL) API.

This file implements the EVEL library which is intended to provide a simple wrapper around the complexity of AT&T's Vendor Event Listener API so that VNFs can use it without worrying about details of:

License

Copyright(c) <2016>, AT&T Intellectual Property. All other rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the AT&T.
  4. Neither the name of AT&T nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY AT&T INTELLECTUAL PROPERTY ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AT&T INTELLECTUAL PROPERTY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file evel.c.

Function Documentation

§ evel_free_event()

void evel_free_event ( void *  event)

Free an event.

Free off the event supplied. Will free all the contained allocated memory.

Note
It is safe to free a NULL pointer.

Definition at line 299 of file evel.c.

§ evel_initialize()

EVEL_ERR_CODES evel_initialize ( const char *const  fqdn,
int  port,
const char *const  path,
const char *const  topic,
int  secure,
const char *const  username,
const char *const  password,
EVEL_SOURCE_TYPES  source_type,
const char *const  role,
int  verbosity 
)

Library initialization.

Initialize the EVEL library.

Note
This function initializes the cURL library. Applications making use of libcurl may need to pull the initialization out of here. Note also that this function is not threadsafe as a result - refer to libcurl's API documentation for relevant warnings.
See also
Matching Term function.
Parameters
fqdnThe API's FQDN or IP address.
portThe API's port.
pathThe optional path (may be NULL).
topicThe optional topic part of the URL (may be NULL).
secureWhether to use HTTPS (0=HTTP, 1=HTTPS)
usernameUsername for Basic Authentication of requests.
passwordPassword for Basic Authentication of requests.
source_typeThe kind of node we represent.
roleThe role this node undertakes.
verbosity0 for normal operation, positive values for chattier logs.
Returns
Status code
Return values
EVEL_SUCCESSOn success
EVEL_ERR_CODESOn failure.

Definition at line 93 of file evel.c.

§ evel_terminate()

EVEL_ERR_CODES evel_terminate ( void  )

Clean up the EVEL library.

Note
that at present don't expect Init/Term cycling not to leak memory!
Returns
Status code
Return values
EVEL_SUCCESSOn success
One of ::EVEL_ERR_CODESOn failure.

Definition at line 260 of file evel.c.

Variable Documentation

§ event_source_type

EVEL_SOURCE_TYPES event_source_type = EVEL_SOURCE_OTHER

The type of equipment represented by this VNF.

Definition at line 58 of file evel.c.

§ functional_role

char* functional_role = NULL

The Functional Role of the equipment represented by this VNF.

Definition at line 63 of file evel.c.