Commit 3fa786ad authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Added namespace-specific filter tags.

darcs-hash:20060105174213-65a35-bc59bb7ea6a567653d1fd491d076a422819cc6ca.gz
parent 9ff71c51
......@@ -54,6 +54,8 @@
#include <http_tag.h>
#include <http_tag_class.h>
tag_typedef_t httptag_any = NSTAG_TYPEDEF(*);
tag_typedef_t httptag_http = HTTPMSGTAG_TYPEDEF(http);
tag_typedef_t httptag_version = STRTAG_TYPEDEF(version);
tag_typedef_t httptag_header =
......
......@@ -80,6 +80,10 @@ HTTP_DLL extern tag_class_t httphdrtag_class[1];
HTTP_DLL extern tag_class_t httpstrtag_class[1];
HTTP_DLL extern tag_class_t httpmsgtag_class[1];
/** Filter tag matching any http tag. */
#define HTTPTAG_ANY() httptag_any, ((tag_value_t)0)
HTTP_DLL extern tag_typedef_t httptag_any;
/**Tag list item for @c http_t object.
*
* The HTTPTAG_HTTP() macro is used to include a tag item for a http_t object
......
......@@ -206,6 +206,9 @@ const char *auth_mod_check_http(auth_mod_t *am,
auth_kind_t proxy);
#endif
#define AUTHTAG_ANY() authtag_any, ((tag_value_t)0)
AUTH_DLL extern tag_typedef_t authtag_any;
/** Pointer to an authentication server (auth_mod_t). */
#define AUTHTAG_MODULE(x) authtag_module, authtag_module_v((x))
AUTH_DLL extern tag_typedef_t authtag_module;
......
......@@ -39,6 +39,12 @@
#include <su_tag_class.h>
#include <url_tag_class.h>
/**@def AUTHTAG_ANY()
*
* Filter tag matching any AUTHTAG_*().
*/
tag_typedef_t authtag_any = NSTAG_TYPEDEF(*);
/**@def AUTHTAG_MODULE()
*
* Pointer to an authentication server module (auth_mod_t).
......
......@@ -43,6 +43,7 @@
#include <sip_tag_class.h>
#include <url_tag_class.h>
tag_typedef_t neatag_any = NSTAG_TYPEDEF(*);
tag_typedef_t neatag_min_expires = UINTTAG_TYPEDEF(min_expires);
tag_typedef_t neatag_expires = UINTTAG_TYPEDEF(expires);
tag_typedef_t neatag_max_expires = UINTTAG_TYPEDEF(max_expires);
......
......@@ -66,6 +66,10 @@ typedef enum {
nea_terminated
} nea_state_t;
/** Filter tag matching any nea tag. */
#define NEATAG_ANY() neatag_any, ((tag_value_t)0)
NEA_DLL extern tag_typedef_t neatag_any;
/** Specify the minimum duration of a subscription (by default, 15 minutes) */
#define NEATAG_MIN_EXPIRES(x) neatag_min_expires, tag_uint_v((x))
NEA_DLL extern tag_typedef_t neatag_min_expires;
......
......@@ -67,6 +67,3 @@ EXTRA_DIST = Doxyfile nta.docs sl_utils.docs \
# Sofia specific rules
include ../sofia.am
# Generate list of nta tags
TAG_DLL_FLAGS = LIST=nta_tag_list
......@@ -47,6 +47,8 @@
#include <sip_protos.h>
tag_typedef_t ntatag_any = NSTAG_TYPEDEF(*);
tag_typedef_t ntatag_mclass = PTRTAG_TYPEDEF(mclass);
tag_typedef_t ntatag_bad_req_mask = UINTTAG_TYPEDEF(bad_req_mask);
tag_typedef_t ntatag_bad_resp_mask = UINTTAG_TYPEDEF(bad_resp_mask);
......
......@@ -51,7 +51,10 @@
SOFIA_BEGIN_DECLS
NTA_DLL extern tag_type_t nta_tag_list[];
/** Filter tag matching any nta tag. */
#define NTATAG_ANY() ntatag_any, ((tag_value_t)0)
NTA_DLL extern tag_typedef_t ntatag_any;
/* Tags for parameters */
......
......@@ -47,6 +47,8 @@
#include <http_protos.h>
tag_typedef_t nthtag_any = NSTAG_TYPEDEF(*);
/* Common */
tag_typedef_t nthtag_mclass = PTRTAG_TYPEDEF(mclass);
tag_typedef_t nthtag_message = PTRTAG_TYPEDEF(message);
......
......@@ -55,7 +55,9 @@ SOFIA_BEGIN_DECLS
#endif
#endif
NTH_DLL extern tagi_t nth_client_tags[];
/** Filter tag matching any nth tag. */
#define NTHTAG_ANY() nthtag_any, ((tag_value_t)0)
NTH_DLL extern tag_typedef_t nthtag_any;
/* Common tags */
......
......@@ -71,5 +71,3 @@ EXTRA_DIST = Doxyfile nua.docs $(BUILT_SOURCES)
# Sofia specific rules
include ../sofia.am
TAG_DLL_FLAGS = LIST=nua_tag_list
......@@ -41,6 +41,8 @@
#include <sip_tag_class.h>
#include <sip_hclasses.h>
tag_typedef_t nutag_any = NSTAG_TYPEDEF(*);
tag_typedef_t nutag_url = URLTAG_TYPEDEF(url);
tag_typedef_t nutag_address = STRTAG_TYPEDEF(address);
tag_typedef_t nutag_uicc = STRTAG_TYPEDEF(uicc);
......
......@@ -63,8 +63,9 @@ typedef struct nua_s nua_t;
/** NUA transaction handle. */
typedef struct nua_handle_s nua_handle_t;
/** List of all NUA tags. */
extern tag_type_t nua_tag_list[];
/** Filter tag matching any nua tag. */
#define NUTAG_ANY() nutag_any, ((tag_value_t)0)
extern tag_typedef_t nutag_any;
/** URL address from application to NUA
*
......
......@@ -660,6 +660,44 @@ int test_api_errors(struct context *ctx)
END();
}
#include <su_tag_class.h>
int test_tag_filter(void)
{
BEGIN();
#undef TAG_NAMESPACE
#define TAG_NAMESPACE "test"
tag_typedef_t tag_a = STRTAG_TYPEDEF(a);
#define TAG_A(s) tag_a, tag_str_v((s))
tag_typedef_t tag_b = STRTAG_TYPEDEF(b);
#define TAG_B(s) tag_b, tag_str_v((s))
tagi_t filter[2] = {{ NUTAG_ANY() }, { TAG_END() }};
tagi_t *lst, *result;
lst = tl_list(TAG_A("X"),
TAG_SKIP(2),
NUTAG_URL((void *)"urn:foo"),
TAG_B("Y"),
NUTAG_URL((void *)"urn:bar"),
TAG_NULL());
TEST_1(lst);
result = tl_afilter(NULL, filter, lst);
TEST_1(result);
TEST(result[0].t_tag, nutag_url);
TEST(result[1].t_tag, nutag_url);
tl_vfree(lst);
free(result);
END();
}
int test_params(struct context *ctx)
{
BEGIN();
......@@ -4797,6 +4835,7 @@ int main(int argc, char *argv[])
} while(0)
retval |= test_api_errors(ctx); SINGLE_FAILURE_CHECK();
retval |= test_tag_filter(); SINGLE_FAILURE_CHECK();
retval |= test_params(ctx); SINGLE_FAILURE_CHECK();
retval |= test_init(ctx, o_iproxy,
......
......@@ -40,6 +40,8 @@
#include <sdp_tag.h>
tag_typedef_t sdptag_any = NSTAG_TYPEDEF(*);
tag_typedef_t sdptag_session = {{
TAG_NAMESPACE, "session", sdptag_session_class
}};
......@@ -53,6 +53,10 @@ SOFIA_BEGIN_DECLS
struct sdp_session_s;
/** Filter tag matching any sdp tag. */
#define SDPTAG_ANY() sdptag_any, ((tag_value_t)0)
SDP_DLL extern tag_typedef_t sdptag_any;
/* Tags for parameters */
SDP_DLL extern tag_typedef_t sdptag_session;
......
......@@ -57,6 +57,8 @@
#include <su_tagarg.h>
tag_typedef_t siptag_any = NSTAG_TYPEDEF(*);
tag_typedef_t siptag_sip = SIPMSGTAG_TYPEDEF(sip);
tag_typedef_t siptag_header = {{ "sip", "header", siphdrtag_class, 0 }};
......@@ -75,16 +77,3 @@ tag_typedef_t siptag_#xxxxxx# = SIPHDRTAG_TYPEDEF(#xxxxxx#);
*/
tag_typedef_t siptag_#xxxxxx#_str = SIPSTRTAG_TYPEDEF(#xxxxxx#);
/** List of all tags for SIP headers */
tag_type_t sip_tag_list[] =
{
siptag_#xxxxxx#,
NULL
};
/** List of all string tags for SIP headers */
tag_type_t sip_tag_str_list[] =
{
siptag_#xxxxxx#_str,
NULL
};
......@@ -76,10 +76,12 @@ SIP_DLL extern tag_class_t sipstrtag_class[1];
/** Tag class for SIP message */
SIP_DLL extern tag_class_t sipmsgtag_class[1];
SIP_DLL extern tag_type_t sip_tag_list[], sip_tag_str_list[];
/** Filter tag matching any sip tag. */
#define SIPTAG_ANY() siptag_any, ((tag_value_t)0)
SIP_DLL extern tag_typedef_t siptag_any;
/** End of SIP headers */
#define SIPTAG_END() siptag_end, (tag_value_t)0
#define SIPTAG_END() siptag_end, (tag_value_t)0
SIP_DLL extern tag_typedef_t siptag_end;
/**Tag list item for #sip_t object.
......
......@@ -48,5 +48,3 @@ EXTRA_DIST = Doxyfile soa.docs $(BUILT_SOURCES)
# Sofia specific rules
include ../sofia.am
TAG_DLL_FLAGS = LIST=soa_tag_list
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment