typedef axl_bool(* VortexProfileMaskFunc)(VortexConnection *connection, int channel_num, const char *uri, const char *profile_content, VortexEncoding encoding, const char *serverName, VortexFrame *frame, char **error_msg, axlPointer user_data)

Profile mask handler used to perform profile filtering functions.

This handler definition is used by:

The handler (a mask) is executed for each profile to be filtered. The function based on the data received must return axl_true (to filter a profile) or axl_false (to not filter it).

The function receives the connection where the filtering is taking place, the profile uri and a user defined pointer configured at the function used to install the mask, along with some data which is optional according to the place that the mask is executed.

Because the profile mask is used by the vortex engine to filter profiles at the greeting process and filter profiles at the channel creation process, data available on such stages differs.

At the greetings process, only uri is available. The value provided for the channel_num is -1 and NULL for profile_content and serverName.

At the channel creation process all values are defined (with the exception of profile_content and serverName which are optional).

Parameters
connectionThe connection that where the filter process will take place.
channel_numThe channel number that is requested in the channel creation stage.
uriA uri reference to the profile check if it should be filtered.
profile_contentThe piggyback provided at the start channel request along with the profile.
encodingProfile content encoding.
serverNameA request for the connection to act as serverName.
frameThe frame that contains the channel start request (when defined: channel_num > 0).
error_msgOptional variable to configure an error message to be returned to the remote peer extending the 554 error used by default. The handler can define a textual message on this variable (dinamically allocated) and then used by vortex to build the error reply. The message configured will be deallocated using axl_free. For example, you can use the following:
1 // check we are not at the greetings process and also check error_msg
2 // which may not be defined
3 if (channel_num > 0 && error_msg) {
4  (* error_msg) = axl_strdup ("Profile not accepted due to policy configuration");
5  // return axl_true to filter the uri
6  return axl_true;
7 }

NOTE: You must not define error_msg and return axl_false.

Parameters
user_dataUser defined pointer passed to the function.
Returns
axl_true to filter the uri, axl_false if not.