#include "config.h"
-#include <sofia-sip/string0.h>
+#include <sofia-sip/su_string.h>
#include <sofia-sip/su.h>
#include <sofia-sip/su_errno.h>
#include <sofia-sip/su_alloc.h>
continue;
if (vtable->vtp_public != public)
continue;
- if (strcasecmp(vtable->vtp_name, protoname))
+ if (!su_casematch(protoname, vtable->vtp_name))
continue;
assert(vtable->vtp_pri_size >= sizeof (tport_primary_t));
for (i = 0, N = 0; transports[i] && N < TPORT_N; i++) {
su_addrinfo_t *ai = &hints[N];
- if (strcasecmp(transports[i], protocol) != 0 &&
- strcmp(protocol, tpn_any) != 0)
+ if (!su_casematch(protocol, transports[i]) && !su_strmatch(protocol, "*"))
continue;
/* Resolve protocol, skip unknown transport protocols. */
hints->ai_canonname = (char *)proto;
#if HAVE_TLS
- if (strcasecmp(proto, "tls") == 0)
+ if (su_casematch(proto, "tls"))
proto = "tcp";
#endif
#if HAVE_SCTP
- if (strcasecmp(proto, "sctp") == 0) {
+ if (su_casematch(proto, "sctp")) {
hints->ai_protocol = IPPROTO_SCTP;
hints->ai_socktype = SOCK_STREAM;
return 0;
}
#endif
- if (strcasecmp(proto, "udp") == 0) {
+ if (su_casematch(proto, "udp")) {
hints->ai_protocol = IPPROTO_UDP;
hints->ai_socktype = SOCK_DGRAM;
return 0;
}
- if (strcasecmp(proto, "tcp") == 0) {
+ if (su_casematch(proto, "tcp")) {
hints->ai_protocol = IPPROTO_TCP;
hints->ai_socktype = SOCK_STREAM;
return 0;
{
if (proto && strcmp(proto, tpn_any) != 0) {
for (; self; self = tport_next(self))
- if (strcasecmp(proto, self->tp_protoname) == 0)
+ if (su_casematch(proto, self->tp_protoname))
break;
}
continue;
#endif
}
- if (proto && strcasecmp(proto, tp->tp_protoname))
+ if (proto && !su_casematch(proto, tp->tp_protoname))
continue;
if (comp && comp != tp->tp_name->tpn_comp) {
SU_DEBUG_7(("tport(%p): found %p by name " TPN_FORMAT "\n",
(void *)self, (void *)sub, TPN_ARGS(tpn)));
}
- else if ((strcasecmp(canon, sub->tp_canon) &&
- strcasecmp(host, sub->tp_host)) ||
- strcmp(port, sub->tp_port))
+ else if (!su_casematch(port, sub->tp_port))
+ continue;
+ else if (!su_casematch(canon, sub->tp_canon) &&
+ !su_casematch(host, sub->tp_host))
continue;
return (tport_t *)sub;
for (b = (char *)url->url_params; b[0]; b += n) {
n = strcspn(b, ";");
- if (n > 10 && strncasecmp(b, "transport=", 10) == 0)
+ if (n > 10 && su_casenmatch(b, "transport=", 10))
tpn->tpn_proto = b + 10;
- else if (n > 6 && strncasecmp(b, "maddr=", 6) == 0)
+ else if (n > 6 && su_casenmatch(b, "maddr=", 6))
tpn->tpn_host = b + 6;
if (b[n])