Main Page | Compound List | File List | Compound Members | File Members | Related Pages

# beepprofile.h File Reference

The BEEP Profile Object. More...

Go to the source code of this file.

## Compounds
struct | sbProfObject
| The BEEP Profile object. More...
## Defines
#define | __LIB3195_BEEPPROFILE_H_INCLUDED__ 1
#define | sbProfCHECKVALIDOBJECT(x) {assert(x != NULL); assert(x->OID == OIDsbProf);}
## Typedefs
typedef sbProfObject | sbProfObj
## Functions
srRetVal | sbProfConstruct (sbProfObj **ppThis, char *pszURI)
| Constructor to create a sbProf.
char * | sbProfGetURI (sbProfObj *pThis)
| Return the profile URI.
void | sbProfDestroy (sbProfObj *pThis)
| Profile Object Destructor.
srRetVal | sbProfSetEventHandler (struct sbProfObject *pThis, sbProfEvent iEvent, srRetVal(*handler)())
| Set and unset an event handler.
srRetVal | sbProfSetAPIObj (sbProfObj *pThis, srAPIObj *pAPI)
| Set the associated API object.
sbProfObj * | sbProfFindProfileMatch (struct sbNVTRObject *pProfListRemote, struct sbNVTRObject *pProfList2)
| Find a matching profile in two lists of profiles.
sbProfObj * | sbProfFindProfile (struct sbNVTRObject *pProfList, char *pszSearch)
| Find a profile based on an URI in a list of profiles.
srRetVal | sbProfSetClntEventHandlers (sbProfObj *pProf, srRetVal(*OnClntOpenLogChan)(struct sbChanObject *pChan), srRetVal(*OnClntSendLogMsg)(struct sbChanObject *pChan, char *szLogmsg), srRetVal(*OnClntSendSLMG)(struct sbChanObject *pChan, struct srSLMGObject *pSLMG), srRetVal(*OnClntCloseLogChan)(struct sbChanObject *pChan))
| Set the 4 mandatory event handlers for client profiles.
sbProfObj * | sbProfFindProfileURIMatch (struct sbNVTRObject *pProfListLocal, struct sbNVTRObject *pURIListRemote)
| Take a list of profile objects AND a list of (remotely supported) profile URIs and find a match in them.

## Detailed Description

The BEEP Profile Object.

Author:
  Rainer Gerhards <rgerhards@adiscon.com>

Date:
  2003-08-04

  2003-09-04 Updated so that a client can have multiple profiles.

Copyright 2002-2003 Rainer Gerhards and Adiscon GmbH. All Rights Reserved.

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

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* 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.

* Neither the name of Adiscon GmbH or Rainer Gerhards 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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.

## Function Documentation

srRetVal sbProfConstruct | ( | sbProfObj ** | ppThis,
|  | char * | pszURI
| ) |

  | Constructor to create a sbProf. Parameters:
  ppThis | [out] pointer to a buffer that will receive the pointer to the newly created profile object.
  szURI | [in] - name of uri to be used in greeting. May be NULL for a profile, that should not be advertised (channel 0 is a meaningful sample).

sbProfObj* sbProfFindProfile | ( | struct sbNVTRObject * | pProfList,
|  | char * | pszSearch
| ) |

  | Find a profile based on an URI in a list of profiles. Parameters:
  pProfileList | Pointer to list of Profiles. May be NULL.
  pszSearch | string to be compared to. Must not be NULL.
  Return values:
  Pointer | to the profile found or NULL, if none found.

sbProfObj* sbProfFindProfileMatch | ( | struct sbNVTRObject * | pProfListRemote,
|  | struct sbNVTRObject * | pProfList2
| ) |

  | Find a matching profile in two lists of profiles. The matching is done based on the URI. If a match is found, we return the pointer to it. If it is not found, we return NULL. The FIRST matching profile will be returned. It is not tried to find the best match. Parameters:
  pProfListRemote | List of remote profiles, created from the greeting. This are NOT profile objects but rather URI strings in pszKey.
  pProfList2 | list (sbNVTRObj) of profiles. MAY BE NULL! (which indicates an empty list of profiles.
  Return values:
  Pointer | to the first matching entry or NULL, if none found.

sbProfObj* sbProfFindProfileURIMatch | ( | struct sbNVTRObject * | pProfListLocal,
|  | struct sbNVTRObject * | pURIListRemote
| ) |

  | Take a list of profile objects AND a list of (remotely supported) profile URIs and find a match in them. The matching is done so that the first local profile found in the remote URI list will be returned. If there are multiple matches, all other matches will be IGNORED. Parameters:
  pProfListLocal | List of locally supported profile objects.
  pURIListRemote | List of remotely supported profile URIs.
  Return values:
  The | matching profile object from the local profile object.

char* sbProfGetURI | ( | sbProfObj * | pThis | ) |

  | Return the profile URI. The returned string is read-only. Return values:
  URI | profile string

srRetVal sbProfSetAPIObj | ( | sbProfObj * | pThis,
|  | srAPIObj * | pAPI
| ) |

  | Set the associated API object. Parameters:
  pAPI | - API object to be set.

srRetVal sbProfSetClntEventHandlers | ( | sbProfObj * | pProf,
|  | srRetVal(* | OnClntOpenLogChan)(struct sbChanObject *pChan),
|  | srRetVal(* | OnClntSendLogMsg)(struct sbChanObject *pChan, char *szLogmsg),
|  | srRetVal(* | OnClntSendSLMG)(struct sbChanObject *pChan, struct srSLMGObject *pSLMG),
|  | srRetVal(* | OnClntCloseLogChan)(struct sbChanObject *pChan)
| ) |

| Set the 4 mandatory event handlers for client profiles. As all of them need to be set for the profile to work, we provide a single call to set them all at once. The param names reflect the names of the event handlers. All event handlers MUST point to actual handlers, none if them is allowed to be NULL.

srRetVal sbProfSetEventHandler | ( | struct sbProfObject * | pThis,
|  | sbProfEvent | iEvent,
|  | srRetVal(* | handler)()
| ) |

  | Set and unset an event handler. A new handler is set for the specified event. To unset it, provide NULL as the handler pointer. Parameters:
  iEvent | Event ID to be modified
  handler | Pointer to event handler. Must follow the semantics of this specific event (will not be checked)