26 #ifndef _SIPWITCH_URI_H_
27 #define _SIPWITCH_URI_H_
29 #ifndef _UCOMMON_STRING_H_
30 #include <ucommon/string.h>
33 #ifndef _UCOMMON_PLATFORM_H_
34 #include <ucommon/platform.h>
37 #ifndef _UCOMMON_SOCKET_H_
38 #include <ucommon/socket.h>
41 #ifndef __SIPWITCH_NAMESPACE_H_
45 #ifndef __SIPWITCH_VOIP_H_
59 static void serviceid(
const char *sipuri,
char *buffer,
size_t size);
60 static bool server(
struct sockaddr *address,
char *buffer,
size_t size);
61 static bool userid(
const char *sipuri,
char *buffer,
size_t size);
62 static bool hostid(
const char *sipuri,
char *buffer,
size_t size);
63 static unsigned short portid(
const char *sipuri);
64 static void identity(
const struct sockaddr *address,
char *buffer,
const char *user,
size_t size);
65 static void publish(
const char *uri,
char *buffer,
const char *user,
size_t size);
69 class __EXPORT
srv :
protected Socket::address
75 struct sockaddr_storage addr;
90 void set(
const char *
uri);
97 inline operator bool()
const
98 {
return entry != NULL;}
101 {
return entry == NULL;}
103 struct sockaddr *next(
void);
105 uint16_t after(uint16_t priority = 0);
107 uint32_t total(uint16_t priority);
109 struct sockaddr *find(uint16_t priority, uint32_t weight);
Some convenience methods for manipulating SIP uri's.
GNU SIP Witch library namespace.
struct sockaddr * operator*() const