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

# beepprofile.c File Reference

Implementation of the BEEP Profile Object. More...

`#include <assert.h>`
`#include "config.h"`
`#include "liblogging.h"`
`#include "beepprofile.h"`
`#include "namevaluetree.h"`

## Functions
char * | sbProfGetURI (sbProfObj *pThis)
| Return the profile URI.
srRetVal | sbProfConstruct (sbProfObj **ppThis, char *pszURI)
| Constructor to create a sbProf.
void | sbProfDestroy (sbProfObj *pThis)
| Profile Object Destructor.
sbProfObj * | sbProfFindProfileURIMatch (sbNVTRObj *pProfListLocal, sbNVTRObj *pURIListRemote)
| Take a list of profile objects AND a list of (remotely supported) profile URIs and find a match in them.
sbProfObj * | sbProfFindProfileMatch (sbNVTRObj *pProfListRemote, sbNVTRObj *pProfList2)
sbProfObj * | sbProfFindProfile (sbNVTRObj *pProfList, char *pszSearch)
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.
srRetVal | sbProfSetAPIObj (sbProfObj *pThis, srAPIObj *pAPI)
| Set the associated API object.
srRetVal | sbProfSetEventHandler (sbProfObj *pThis, sbProfEvent iEvent, srRetVal(*handler)())

## Detailed Description

Implementation of the BEEP Profile Object.

Author:
  Rainer Gerhards <rgerhards@adiscon.com>

Date:
  2003-08-04

  2003-09-04 begin coding support for multiple client profiles (the initial design just allowed one).

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* sbProfFindProfileURIMatch | ( | sbNVTRObj * | pProfListLocal,
|  | sbNVTRObj * | 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.