Adding a new parameter

From reSIProcate

Jump to: navigation, search

NOTE that proprietary or experimental parameters may be better added at runtime rather than at compile time. See Extension Parameter.

NOTE that you MUST update the gperf hash description files and run the test drivers to ensure that the new hash function works as intended. The hash output from gperf MUST be modified to produce a case-insensitive hash. At present, the autotools (resiprocate/sip/autotools/...) build system contains a rule that does this properly, I am not certain that the build/Makefile system does this correctly.

Contents

[edit] ParameterTypeEnums.hxx

Add a call to the macro defineParam to the enum. The arugments are:

* parameter access token name
* RFC name
* resip parameter type
* reference

For example:

defineParam(accessType, "access-type", DataParameter, "RFC 2046"),

Note that the macro call is followed by a comma.

The new parameter will be accessible as p_ followed by the parameter access token name. This accessor will be available on any header. The usual exists and remove methods will also be available.

[edit] ParameterHash.gperf

Near the end of the file and before the "%%", add the RFC name in lower case, a comma, and ParameterTypes:: followed by the access token name. For example:

access-type, ParameterTypes::accessType

[edit] ParameterTypes.hxx

Add the same macro call used in ParameterTypeEnums.hxx. Note that the macro call is followed by a semi-colon.

[edit] ParameterTypes.cxx

Add the same macro call used in ParameterTypeEnums.hxx. Note that the macro call is followed by a semi-colon.

[edit] ParserCategory.hxx

Add the same macro call used in ParameterTypeEnums.hxx to the public part of the class declaration for ParserCategory, after the definition of the defineParamm macro. Note that the macro call is followed by a semi-colon.

[edit] ParserCategory.cxx

Add the same macro call used in ParameterTypeEnums.hxx, after the definition of the defineParamm macro. Note that the macro call is followed by a semi-colon.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox