reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Plugin.hxx
Go to the documentation of this file.
1#ifndef REPRO_PLUGIN_HXX
2#define REPRO_PLUGIN_HXX
3
4#include "rutil/Plugin.hxx"
5#include "rutil/ResipAssert.h"
6
10
11/* repro plugin DSO support
12 *
13 * This is a new feature for v1.9. Developers can create plugins as
14 * standalone shared object files and load them at runtime.
15 *
16 * This makes it easy to create new functionality without recompiling repro
17 * itself. It also makes it easy to distribute third-party plugins as
18 * standalone packages.
19 *
20 * IMPORTANT NOTE:
21 * The plugin API is not guaranteed to remain absolutely constant between
22 * releases of reSIProcate. The version check mechanism will simply reject
23 * plugins compiled for a newer or older version of the API.
24 * In this first release of DSO support, we have provided a very simple
25 * set of functions so that if a future version of this API is very
26 * different, developers using the current API will not need to change too
27 * much to adapt their code.
28 *
29 * GETTING STARTED
30 * See the example plugin in repro/plugins/example
31 * It should be fairly easy to copy the Makefile.am and ExamplePlugin.cxx,
32 * add your own configure.ac and build your own standalone project outside the
33 * reSIProcate source tree. Naturally, you will need to include the
34 * reSIProcate headers on your build path somewhere.
35 */
36
37// If the API changes, this number changes too:
38#define REPRO_DSO_PLUGIN_API_VERSION 3
39
40namespace repro
41{
42
43class Plugin : public resip::Plugin
44{
45 public:
46 Plugin(){};
47 virtual ~Plugin(){};
48
49 /* Initialize the plugin, called shortly after loading and
50 before repro drops privileges.
51 @returns true if successful */
53
54 /* called after the request processor chain has been populated */
56
57 /* called after the response processor chain has been populated */
59
60 /* called after the target processor chain has been populated */
62
63};
64
66{
67 public:
69 virtual ~ReproPluginManager();
70
71 /* called after the request processor chain has been populated */
73
74 /* called after the response processor chain has been populated */
76
77 /* called after the target processor chain has been populated */
79
80 protected:
81 virtual bool onPluginLoaded(std::shared_ptr<resip::Plugin> plugin) override;
82
83 private:
84 resip::SipStack& mSipStack;
85 ProxyConfig *mProxyConfig;
86};
87
88}
89
90#endif
91
92/* ====================================================================
93 *
94 * Copyright (c) 2022, Software Freedom Institute https://softwarefreedom.institute
95 * Copyright (c) 2013-2022, Daniel Pocock https://danielpocock.com
96 *
97 * Redistribution and use in source and binary forms, with or without
98 * modification, are permitted provided that the following conditions
99 * are met:
100 *
101 * 1. Redistributions of source code must retain the above copyright
102 * notice, this list of conditions and the following disclaimer.
103 *
104 * 2. Redistributions in binary form must reproduce the above copyright
105 * notice, this list of conditions and the following disclaimer in
106 * the documentation and/or other materials provided with the
107 * distribution.
108 *
109 * 3. Neither the name of the author(s) nor the names of any contributors
110 * may be used to endorse or promote products derived from this software
111 * without specific prior written permission.
112 *
113 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
114 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
115 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
116 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
117 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
118 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
119 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
120 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
121 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
122 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
123 * SUCH DAMAGE.
124 *
125 * ====================================================================
126 *
127 *
128 */
129
virtual void onRequestProcessorChainPopulated(ProcessorChain &chain)=0
virtual void onTargetProcessorChainPopulated(ProcessorChain &chain)=0
virtual ~Plugin()
Definition Plugin.hxx:47
virtual void onResponseProcessorChainPopulated(ProcessorChain &chain)=0
virtual bool init(resip::SipStack &sipStack, ProxyConfig *proxyConfig)=0
virtual void onResponseProcessorChainPopulated(ProcessorChain &chain)
Definition Plugin.cxx:56
virtual void onRequestProcessorChainPopulated(ProcessorChain &chain)
Definition Plugin.cxx:43
virtual ~ReproPluginManager()
Definition Plugin.cxx:26
virtual bool onPluginLoaded(std::shared_ptr< resip::Plugin > plugin) override
Definition Plugin.cxx:31
virtual void onTargetProcessorChainPopulated(ProcessorChain &chain)
Definition Plugin.cxx:70
This is the primary point of interaction between the app-layer and the stack.
Definition SipStack.hxx:160
This Class is used to implement a primitive form of RPC using loose XML formatting.
void list()
Definition userAdmin.cxx:66