Update AKAv2 algorithm and begin adding support for ETSI NASS Bundled.

Update DHCP/BOOTP STACK(DISCOVER, INFORM and REQUEST).
This commit is contained in:
bossiel 2010-02-08 18:44:08 +00:00
parent 2bee552616
commit 146fd99cb8
20 changed files with 935 additions and 383 deletions

View File

@ -29,11 +29,14 @@
*/ */
#include "tnet_dhcp.h" #include "tnet_dhcp.h"
#include "tsk_string.h"
#include "tsk_thread.h" #include "tsk_thread.h"
#include "tsk_memory.h" #include "tsk_memory.h"
#include "tsk_time.h" #include "tsk_time.h"
#include "tsk_debug.h" #include "tsk_debug.h"
//#include <string.h>
// Useful link: http://support.microsoft.com/?scid=kb%3Ben-us%3B169289&x=21&y=14 // Useful link: http://support.microsoft.com/?scid=kb%3Ben-us%3B169289&x=21&y=14
// Another one: http://www.iana.org/assignments/bootp-dhcp-parameters/ // Another one: http://www.iana.org/assignments/bootp-dhcp-parameters/
@ -108,6 +111,12 @@ tnet_dhcp_reply_t* tnet_dhcp_send_request(tnet_dhcp_ctx_t* ctx, tnet_dhcp_reques
do do
{ {
/* RFC 2131 - 3.6 Use of DHCP in clients with multiple interfaces
A client with multiple network interfaces must use DHCP through each
interface independently to obtain configuration information
parameters for those separate interfaces.
*/
tsk_list_foreach(item, ctx->interfaces) tsk_list_foreach(item, ctx->interfaces)
{ {
iface = item->data; iface = item->data;
@ -116,13 +125,27 @@ tnet_dhcp_reply_t* tnet_dhcp_send_request(tnet_dhcp_ctx_t* ctx, tnet_dhcp_reques
FD_ZERO(&set); FD_ZERO(&set);
FD_SET(clientFD, &set); FD_SET(clientFD, &set);
/* ciaddr */
if(request->type == dhcp_type_inform){
struct sockaddr_storage ss;
if(!tnet_get_sockaddr(clientFD, &ss)){
if(ctx->use_ipv6){
// FIXME
}
else{
uint32_t addr = htonl((*((uint32_t*)&((struct sockaddr_in*)&ss)->sin_addr)));
memcpy(&request->ciaddr, &addr, 4);
}
}
}
/* chaddr */ /* chaddr */
memset(request->chaddr, 0, sizeof(request->chaddr)); memset(request->chaddr, 0, sizeof(request->chaddr));
request->hlen = iface->mac_address_length > sizeof(request->chaddr) ? sizeof(request->chaddr) : iface->mac_address_length; request->hlen = iface->mac_address_length > sizeof(request->chaddr) ? sizeof(request->chaddr) : iface->mac_address_length;
memcpy(request->chaddr, iface->mac_address, request->hlen); memcpy(request->chaddr, iface->mac_address, request->hlen);
/* Serialize and send to the server. */ /* Serialize and send to the server. */
if(!(output = tnet_dhcp_message_serialize(request))) if(!(output = tnet_dhcp_message_serialize(ctx, request)))
{ {
TSK_DEBUG_ERROR("Failed to serialize the DHCP message."); TSK_DEBUG_ERROR("Failed to serialize the DHCP message.");
goto next_iface; goto next_iface;
@ -167,7 +190,7 @@ tnet_dhcp_reply_t* tnet_dhcp_send_request(tnet_dhcp_ctx_t* ctx, tnet_dhcp_reques
} }
/* Parse the incoming response. */ /* Parse the incoming response. */
reply = tnet_dhcp_message_deserialize(data, len); reply = tnet_dhcp_message_deserialize(ctx, data, len);
TSK_FREE(data); TSK_FREE(data);
if(reply) if(reply)
@ -196,7 +219,7 @@ bail:
return reply; return reply;
} }
tnet_dhcp_reply_t* tnet_dhcp_query(tnet_dhcp_ctx_t* ctx, tnet_dhcp_params_t* params) tnet_dhcp_reply_t* tnet_dhcp_query(tnet_dhcp_ctx_t* ctx, tnet_dhcp_message_type_t type, tnet_dhcp_params_t* params)
{ {
tnet_dhcp_reply_t* reply = 0; tnet_dhcp_reply_t* reply = 0;
tnet_dhcp_request_t* request = TNET_DHCP_REQUEST_CREATE(); tnet_dhcp_request_t* request = TNET_DHCP_REQUEST_CREATE();
@ -206,8 +229,9 @@ tnet_dhcp_reply_t* tnet_dhcp_query(tnet_dhcp_ctx_t* ctx, tnet_dhcp_params_t* par
goto bail; goto bail;
} }
//request->op = params->tag; request->type = type;
request->type = dhcp_type_discover; // FIXME tnet_dhcp_message_add_codes(request, params->codes, params->codes_count);
reply = tnet_dhcp_send_request(ctx, request); reply = tnet_dhcp_send_request(ctx, request);
bail: bail:
@ -217,7 +241,22 @@ bail:
} }
int tnet_dhcp_params_add_code(tnet_dhcp_params_t* params, tnet_dhcp_option_code_t code)
{
if(params){
if(params->codes_count < TNET_DHCP_MAX_CODES){
unsigned i;
for(i=0; i<params->codes_count; i++){
if(params->codes[i] == code){
return -3;
}
}
params->codes[params->codes_count++] = code;
}
else return -2;
}
return -1;
}
@ -229,6 +268,12 @@ static void* tnet_dhcp_ctx_create(void * self, va_list * app)
tnet_dhcp_ctx_t *ctx = self; tnet_dhcp_ctx_t *ctx = self;
if(ctx) if(ctx)
{ {
tnet_host_t host;
ctx->vendor_id = tsk_strdup(TNET_DHCP_VENDOR_ID_DEFAULT);
if(!tnet_gethostname(&host)){
ctx->hostname = tsk_strndup(host, strlen(host));
}
ctx->timeout = TNET_DHCP_TIMEOUT_DEFAULT; ctx->timeout = TNET_DHCP_TIMEOUT_DEFAULT;
ctx->port_client = TNET_DHCP_CLIENT_PORT; ctx->port_client = TNET_DHCP_CLIENT_PORT;
ctx->server_port = TNET_DHCP_SERVER_PORT; ctx->server_port = TNET_DHCP_SERVER_PORT;
@ -250,6 +295,9 @@ static void* tnet_dhcp_ctx_destroy(void * self)
if(ctx) if(ctx)
{ {
tsk_safeobj_deinit(ctx); tsk_safeobj_deinit(ctx);
TSK_FREE(ctx->vendor_id);
TSK_FREE(ctx->hostname);
TSK_OBJECT_SAFE_FREE(ctx->interfaces); TSK_OBJECT_SAFE_FREE(ctx->interfaces);
} }
@ -273,7 +321,6 @@ static void* tnet_dhcp_params_create(void * self, va_list * app)
tnet_dhcp_params_t *params = self; tnet_dhcp_params_t *params = self;
if(params) if(params)
{ {
params->tag = va_arg(*app, tnet_dhcp_option_tag_t);
} }
return self; return self;
} }

View File

@ -43,7 +43,7 @@
TNET_BEGIN_DECLS TNET_BEGIN_DECLS
#define TNET_DHCP_CTX_CREATE() tsk_object_new(tnet_dhcp_ctx_def_t) #define TNET_DHCP_CTX_CREATE() tsk_object_new(tnet_dhcp_ctx_def_t)
#define TNET_DHCP_PARAMS_CREATE(tag) tsk_object_new(tnet_dhcp_params_def_t, (tnet_dhcp_option_tag_t)tag) #define TNET_DHCP_PARAMS_CREATE() tsk_object_new(tnet_dhcp_params_def_t)
/** Default timeout (in milliseconds) value for DHCP requests. /** Default timeout (in milliseconds) value for DHCP requests.
*/ */
@ -54,12 +54,17 @@ TNET_BEGIN_DECLS
/**< Destination port(Server) for outgoing DHCP messages as per RFC 2131 subclause 4.1. */ /**< Destination port(Server) for outgoing DHCP messages as per RFC 2131 subclause 4.1. */
#define TNET_DHCP_SERVER_PORT 67 #define TNET_DHCP_SERVER_PORT 67
#define TNET_DHCP_VENDOR_ID_DEFAULT "IM-client/OMA1.0 doubango/v0.0.0"
#define TNET_DHCP_MAX_CODES 20
/** Parameter Request List (55)
*/
typedef struct tnet_dhcp_params_s typedef struct tnet_dhcp_params_s
{ {
TSK_DECLARE_OBJECT; TSK_DECLARE_OBJECT;
tnet_dhcp_option_tag_t tag; /**< Option tag. Mandatory. */ tnet_dhcp_option_code_t codes[TNET_DHCP_MAX_CODES];
unsigned codes_count;
} }
tnet_dhcp_params_t; tnet_dhcp_params_t;
@ -67,6 +72,9 @@ typedef struct tnet_dhcp_ctx_s
{ {
TSK_DECLARE_OBJECT; TSK_DECLARE_OBJECT;
char* vendor_id;
char* hostname;
uint64_t timeout; uint64_t timeout;
unsigned use_ipv6; unsigned use_ipv6;
@ -80,7 +88,14 @@ typedef struct tnet_dhcp_ctx_s
tnet_dhcp_ctx_t; tnet_dhcp_ctx_t;
TINYNET_API tnet_dhcp_reply_t* tnet_dhcp_query(tnet_dhcp_ctx_t* ctx, tnet_dhcp_params_t* params); TINYNET_API tnet_dhcp_reply_t* tnet_dhcp_query(tnet_dhcp_ctx_t* ctx, tnet_dhcp_message_type_t type, tnet_dhcp_params_t* params);
#define tnet_dhcp_query_discover(ctx, params) tnet_dhcp_query(ctx, dhcp_type_discover, params)
#define tnet_dhcp_query_request(ctx, params) tnet_dhcp_query(ctx, dhcp_type_request, params)
#define tnet_dhcp_query_decline(ctx, params) tnet_dhcp_query(ctx, dhcp_type_decline, params)
#define tnet_dhcp_query_release(ctx, params) tnet_dhcp_query(ctx, dhcp_type_release, params)
#define tnet_dhcp_query_inform(ctx, params) tnet_dhcp_query(ctx, dhcp_type_inform, params)
TINYNET_API int tnet_dhcp_params_add_code(tnet_dhcp_params_t* params, tnet_dhcp_option_code_t code);
TINYNET_GEXTERN const void *tnet_dhcp_ctx_def_t; TINYNET_GEXTERN const void *tnet_dhcp_ctx_def_t;
TINYNET_GEXTERN const void *tnet_dhcp_params_def_t; TINYNET_GEXTERN const void *tnet_dhcp_params_def_t;

View File

@ -27,36 +27,22 @@
* @date Created: Sat Nov 8 16:54:58 2009 mdiop * @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/ */
#include "tnet_dhcp_message.h" #include "tnet_dhcp_message.h"
#include "tnet_dhcp.h"
#include "../tnet_utils.h" #include "../tnet_utils.h"
int tnet_dhcp_message_serialize_type(const tnet_dhcp_message_t *message, tsk_buffer_t* output) #include "tsk_time.h"
{ #include "tsk_memory.h"
uint8_t _1byte; #include "tsk_string.h"
if(message && output) #include "tsk_debug.h"
{
/* Option */
_1byte = dhcp_tag_DHCP_Msg_Type;
tsk_buffer_append(output, &(_1byte), 1);
/* Length */
_1byte = 1;
tsk_buffer_append(output, &(_1byte), 1);
/* Value */
_1byte = message->type;
tsk_buffer_append(output, &(_1byte), 1);
return 0; tsk_buffer_t* tnet_dhcp_message_serialize(const struct tnet_dhcp_ctx_s *ctx, const tnet_dhcp_message_t *message)
}
return -1;
}
tsk_buffer_t* tnet_dhcp_message_serialize(const tnet_dhcp_message_t *message)
{ {
tsk_buffer_t* output = 0; tsk_buffer_t* output = 0;
uint8_t _1byte; uint8_t _1byte;
uint16_t _2bytes; uint16_t _2bytes;
uint32_t _4bytes; uint32_t _4bytes;
/* Check message validity */ /* Check message validity */
if(!message) if(!message)
{ {
@ -105,21 +91,66 @@ tsk_buffer_t* tnet_dhcp_message_serialize(const tnet_dhcp_message_t *message)
/*== Message Type (option 53) /*== Message Type (option 53)
*/ */
tnet_dhcp_message_serialize_type(message, output); tnet_dhcp_option_serializeex(dhcp_code_DHCP_Msg_Type, 1, &message->type, output);
/*== Client Identifier (option 61) ==> RFC 2132 - 9.14. Client-identifier
Code Len Type Client-Identifier
+-----+-----+-----+-----+-----+---
| 61 | n | t1 | i1 | i2 | ...
+-----+-----+-----+-----+-----+---
*/
if(message->hlen){
uint8_t client_id[17]; // 16 /*sizeof(chaddr)*/+ 1/*htype*/
/*if(client_id)*/{
client_id[0] = message->htype;
memcpy(&client_id[1], message->chaddr, message->hlen);
tnet_dhcp_option_serializeex(dhcp_code_Client_Id, (message->hlen+1), client_id, output);
}
}
/*== Host name(10) ==> RFC 2132 - 3.14. Host Name Option
Code Len Host Name
+-----+-----+-----+-----+-----+-----+-----+-----+--
| 12 | n | h1 | h2 | h3 | h4 | h5 | h6 | ...
+-----+-----+-----+-----+-----+-----+-----+-----+--
*/
if(TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->hostname){
tnet_dhcp_option_serializeex(dhcp_code_Hostname, strlen(ctx->hostname), ctx->hostname, output);
}
/*== Vendor classId(60) ==> RFC 2132 - 9.13. Vendor class identifier
Code Len Vendor class Identifier
+-----+-----+-----+-----+---
| 60 | n | i1 | i2 | ...
+-----+-----+-----+-----+---
*/
if(TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->vendor_id){
tnet_dhcp_option_serializeex(dhcp_code_Class_Id, strlen(ctx->vendor_id), ctx->vendor_id, output);
}
/*== DHCP Options /*== DHCP Options
*/ */
{
tsk_list_item_t *item;
tnet_dhcp_option_t* option;
tsk_list_foreach(item, message->options)
{
option = (tnet_dhcp_option_t*)item->data;
if(tnet_dhcp_option_serialize(option, output)){
TSK_DEBUG_WARN("Failed to serialize DHCP OPTION (%u)", option->code);
}
}
}
/* RFC 2131 - 4.1 Constructing and sending DHCP messages
/*== DHCP Option End*/ The last option must always be the 'end' option.
_1byte = dhcp_tag_End; */
_1byte = dhcp_code_End;
tsk_buffer_append(output, &(_1byte), 1); tsk_buffer_append(output, &(_1byte), 1);
bail: bail:
return output; return output;
} }
tnet_dhcp_message_t* tnet_dhcp_message_deserialize(const uint8_t *data, size_t size) tnet_dhcp_message_t* tnet_dhcp_message_deserialize(const struct tnet_dhcp_ctx_s *ctx, const uint8_t *data, size_t size)
{ {
tnet_dhcp_message_t *message = 0; tnet_dhcp_message_t *message = 0;
@ -128,11 +159,70 @@ tnet_dhcp_message_t* tnet_dhcp_message_deserialize(const uint8_t *data, size_t s
goto bail; goto bail;
} }
if(size < TNET_DHCP_MESSAGE_MIN_SIZE){
TSK_DEBUG_ERROR("DHCP message too short.");
goto bail;
}
if(!(message = TNET_DHCP_REPLY_CREATE())){ /* If REQUEST OP will be overridedden */
TSK_DEBUG_ERROR("Failed to create new DHCP message.");
goto bail;
}
/*== op (1)*/
bail: bail:
return message; return message;
} }
const tnet_dhcp_option_t* tnet_dhcp_message_find_option(const tnet_dhcp_message_t *message, tnet_dhcp_option_code_t code)
{
tsk_list_item_t *item;
if(!message){
goto bail;
}
tsk_list_foreach(item, message->options)
{
if(((tnet_dhcp_option_t*)item->data)->code == code){
return ((tnet_dhcp_option_t*)item->data);
}
}
bail:
return 0;
}
int tnet_dhcp_message_add_codes(tnet_dhcp_message_t *self, tnet_dhcp_option_code_t codes[], unsigned codes_count)
{
int ret = -1;
if(!self){
goto bail;
}
if(codes_count){
unsigned i;
tnet_dhcp_option_paramslist_t* option = (tnet_dhcp_option_paramslist_t*)tnet_dhcp_message_find_option(self, dhcp_code_Parameter_List);
if(!option){
tnet_dhcp_option_paramslist_t *option_paramslist = TNET_DHCP_OPTION_PARAMSLIST_CREATE();
option = option_paramslist;
tsk_list_push_back_data(self->options, (void**)&option_paramslist);
}
for(i=0; i<codes_count; i++){
if((ret = tnet_dhcp_option_paramslist_add_code(option, codes[i]))){
break;
}
}
}
bail:
return ret;
}
//======================================================== //========================================================
// [[DHCP MESSAGE]] object definition // [[DHCP MESSAGE]] object definition
@ -142,7 +232,7 @@ static void* tnet_dhcp_message_create(void * self, va_list * app)
tnet_dhcp_message_t *message = self; tnet_dhcp_message_t *message = self;
if(message) if(message)
{ {
static uint32_t __dhcpmessage_unique_xid = 0; static uint32_t __dhcpmessage_unique_xid = 0;//(uint32_t)tsk_time_epoch();
message->op = va_arg(*app, tnet_dhcp_message_op_t); message->op = va_arg(*app, tnet_dhcp_message_op_t);
message->htype = dhcp_htype_Ethernet_10Mb; message->htype = dhcp_htype_Ethernet_10Mb;

View File

@ -42,8 +42,13 @@ TNET_BEGIN_DECLS
#define TNET_DHCP_REQUEST_CREATE() TNET_DHCP_MESSAGE_CREATE(dhcp_op_bootrequest) #define TNET_DHCP_REQUEST_CREATE() TNET_DHCP_MESSAGE_CREATE(dhcp_op_bootrequest)
#define TNET_DHCP_REPLY_CREATE() TNET_DHCP_MESSAGE_CREATE(dhcp_op_bootreply) #define TNET_DHCP_REPLY_CREATE() TNET_DHCP_MESSAGE_CREATE(dhcp_op_bootreply)
#define TNET_DHCP_MESSAGE_IS_REQUEST(self) ((self) && ((self)->op==dhcp_op_bootrequest))
#define TNET_DHCP_MESSAGE_IS_REPLY(self) ((self) && ((self)->op==dhcp_op_bootreply))
#define TNET_DHCP_MAGIC_COOKIE 0x63825363 /**< DHCP magic cookie (99, 130, 83 and 99 in decimal).*/ #define TNET_DHCP_MAGIC_COOKIE 0x63825363 /**< DHCP magic cookie (99, 130, 83 and 99 in decimal).*/
#define TNET_DHCP_MESSAGE_MIN_SIZE 223 /* Is it rigth? */
/** List of all supported DHCP message (see RFC 2131). /** List of all supported DHCP message (see RFC 2131).
*/ */
typedef enum tnet_dhcp_message_type_e typedef enum tnet_dhcp_message_type_e
@ -134,10 +139,9 @@ typedef struct tnet_dhcp_message_s
{ {
TSK_DECLARE_OBJECT; TSK_DECLARE_OBJECT;
/** DHCP message type. Mandatory. /**< DHCP message type. Mandatory.
*/ */
tnet_dhcp_message_type_t type; tnet_dhcp_message_type_t type;
/* /*
0 1 2 3 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
@ -233,8 +237,10 @@ typedef tnet_dhcp_message_t tnet_dhcp_reply_t; /**< BOOTREPLY message. */
TINYNET_GEXTERN const void *tnet_dhcp_message_def_t; TINYNET_GEXTERN const void *tnet_dhcp_message_def_t;
tsk_buffer_t* tnet_dhcp_message_serialize(const tnet_dhcp_message_t *message); tsk_buffer_t* tnet_dhcp_message_serialize(const struct tnet_dhcp_ctx_s *ctx, const tnet_dhcp_message_t *self);
tnet_dhcp_message_t* tnet_dhcp_message_deserialize(const uint8_t *data, size_t size); tnet_dhcp_message_t* tnet_dhcp_message_deserialize(const struct tnet_dhcp_ctx_s *ctx, const uint8_t *data, size_t size);
const tnet_dhcp_option_t* tnet_dhcp_message_find_option(const tnet_dhcp_message_t *self, tnet_dhcp_option_code_t code);
int tnet_dhcp_message_add_codes(tnet_dhcp_message_t *self, tnet_dhcp_option_code_t codes[], unsigned codes_count);
TNET_END_DECLS TNET_END_DECLS

View File

@ -29,14 +29,14 @@
#include "tnet_dhcp_option.h" #include "tnet_dhcp_option.h"
int tnet_dhcp_option_init(tnet_dhcp_option_t *option, tnet_dhcp_option_tag_t tag) int tnet_dhcp_option_init(tnet_dhcp_option_t *option, tnet_dhcp_option_code_t code)
{ {
if(option) if(option)
{ {
if(!option->initialized) if(!option->initialized)
{ {
option->tag = tag; option->code = code;
option->data = TSK_BUFFER_CREATE_NULL(); option->value = TSK_BUFFER_CREATE_NULL();
option->initialized = 1; option->initialized = 1;
return 0; return 0;
@ -52,7 +52,7 @@ int tnet_dhcp_option_deinit(tnet_dhcp_option_t *option)
{ {
if(option->initialized) if(option->initialized)
{ {
TSK_OBJECT_SAFE_FREE(option->data); TSK_OBJECT_SAFE_FREE(option->value);
option->initialized = 0; option->initialized = 0;
return 0; return 0;
@ -80,11 +80,37 @@ bail:
int tnet_dhcp_option_serialize(const tnet_dhcp_option_t* option, tsk_buffer_t *output) int tnet_dhcp_option_serialize(const tnet_dhcp_option_t* option, tsk_buffer_t *output)
{ {
if(!option || !output)
{
return -1;
}
/* Code */
tsk_buffer_append(output, &(option->code), 1);
/* Length */
tsk_buffer_append(output, &(option->value->size), 1);
/* Value */
tsk_buffer_append(output, option->value->data, option->value->size);
return 0; return 0;
} }
int tnet_dhcp_option_serializeex(tnet_dhcp_option_code_t code, uint8_t length, const void* value, tsk_buffer_t *output)
{
if(value && length && output)
{
tsk_buffer_append(output, &(code), 1);
tsk_buffer_append(output, &(length), 1);
tsk_buffer_append(output, value, length);
return 0;
}
return -1;
}
//======================================================== //
// [[DHCP OPTION]] object definition // [[DHCP OPTION]] object definition
// //
static void* tnet_dhcp_option_create(void * self, va_list * app) static void* tnet_dhcp_option_create(void * self, va_list * app)
@ -92,7 +118,7 @@ static void* tnet_dhcp_option_create(void * self, va_list * app)
tnet_dhcp_option_t *option = self; tnet_dhcp_option_t *option = self;
if(option) if(option)
{ {
tnet_dhcp_option_init(option, dhcp_tag_null); tnet_dhcp_option_init(option, dhcp_code_null);
} }
return self; return self;
} }
@ -114,4 +140,51 @@ static const tsk_object_def_t tnet_dhcp_option_def_s =
tnet_dhcp_option_destroy, tnet_dhcp_option_destroy,
0, 0,
}; };
const void *tnet_dhcp_option_def_t = &tnet_dhcp_option_def_s; const void *tnet_dhcp_option_def_t = &tnet_dhcp_option_def_s;
/*=============================================
* RFC 2132 - 9.8. Parameter Request List
*==============================================*/
int tnet_dhcp_option_paramslist_add_code(tnet_dhcp_option_paramslist_t* self, tnet_dhcp_option_code_t code)
{
if(self){
return tsk_buffer_append(TNET_DHCP_OPTION(self)->value, &code, 1);
}
return -1;
}
//
// [[DHCP OPTION - RFC 2132 9.8. Parameter Request List]] object definition
//
static void* tnet_dhcp_option_paramslist_create(void * self, va_list * app)
{
tnet_dhcp_option_paramslist_t *option = self;
if(option)
{
/* init base */
tnet_dhcp_option_init(TNET_DHCP_OPTION(option), dhcp_code_Parameter_List);
}
return self;
}
static void* tnet_dhcp_option_paramslist_destroy(void * self)
{
tnet_dhcp_option_paramslist_t *option = self;
if(option)
{
/* deinit base */
tnet_dhcp_option_deinit(TNET_DHCP_OPTION(option));
}
return self;
}
static const tsk_object_def_t tnet_dhcp_option_paramslist_def_s =
{
sizeof(tnet_dhcp_option_paramslist_t),
tnet_dhcp_option_paramslist_create,
tnet_dhcp_option_paramslist_destroy,
0,
};
const void *tnet_dhcp_option_paramslist_def_t = &tnet_dhcp_option_paramslist_def_s;

View File

@ -37,182 +37,183 @@
TNET_BEGIN_DECLS TNET_BEGIN_DECLS
#define TNET_DHCP_OPTION_CREATE() tsk_object_new(tnet_dhcp_option_def_t) #define TNET_DHCP_OPTION_CREATE() tsk_object_new(tnet_dhcp_option_def_t)
#define TNET_DHCP_OPTION_PARAMSLIST_CREATE() tsk_object_new(tnet_dhcp_option_paramslist_def_t)
#define TNET_DHCP_OPTION(self) ((tnet_dhcp_option_t*)(self)) #define TNET_DHCP_OPTION(self) ((tnet_dhcp_option_t*)(self))
typedef enum tnet_dhcp_option_tag_e typedef enum tnet_dhcp_option_code_e
{ {
dhcp_tag_Pad= 0 ,/**< Pad 0 None [RFC2132] */ dhcp_code_Pad= 0 ,/**< Pad 0 None [RFC2132] */
dhcp_tag_Subnet_Mask= 1 ,/**< Subnet Mask 4 Subnet Mask Value [RFC2132] */ dhcp_code_Subnet_Mask= 1 ,/**< Subnet Mask 4 Subnet Mask Value [RFC2132] */
dhcp_tag_Time_Offset= 2 ,/**< Time Offset 4 Time Offset in Seconds from UTC [RFC2132] (note: deprecated by 100 and 101) */ dhcp_code_Time_Offset= 2 ,/**< Time Offset 4 Time Offset in Seconds from UTC [RFC2132] (note: deprecated by 100 and 101) */
dhcp_tag_Router= 3 ,/**< Router N N/4 Router addresses [RFC2132] */ dhcp_code_Router= 3 ,/**< Router N N/4 Router addresses [RFC2132] */
dhcp_tag_Time_Server= 4 ,/**< Time Server N N/4 Timeserver addresses [RFC2132] */ dhcp_code_Time_Server= 4 ,/**< Time Server N N/4 Timeserver addresses [RFC2132] */
dhcp_tag_Name_Server= 5 ,/**< Name Server N N/4 IEN-116 Server addresses [RFC2132] */ dhcp_code_Name_Server= 5 ,/**< Name Server N N/4 IEN-116 Server addresses [RFC2132] */
dhcp_tag_Domain_Server= 6 ,/**< Domain Server N N/4 DNS Server addresses [RFC2132] */ dhcp_code_Domain_Server= 6 ,/**< Domain Server N N/4 DNS Server addresses [RFC2132] */
dhcp_tag_Log_Server= 7 ,/**< Log Server N N/4 Logging Server addresses [RFC2132] */ dhcp_code_Log_Server= 7 ,/**< Log Server N N/4 Logging Server addresses [RFC2132] */
dhcp_tag_Quotes_Server= 8 ,/**< Quotes Server N N/4 Quotes Server addresses [RFC2132] */ dhcp_code_Quotes_Server= 8 ,/**< Quotes Server N N/4 Quotes Server addresses [RFC2132] */
dhcp_tag_LPR_Server= 9 ,/**< LPR Server N N/4 Printer Server addresses [RFC2132] */ dhcp_code_LPR_Server= 9 ,/**< LPR Server N N/4 Printer Server addresses [RFC2132] */
dhcp_tag_Impress_Server= 10 ,/**< Impress Server N N/4 Impress Server addresses [RFC2132] */ dhcp_code_Impress_Server= 10 ,/**< Impress Server N N/4 Impress Server addresses [RFC2132] */
dhcp_tag_RLP_Server= 11 ,/**< RLP Server N N/4 RLP Server addresses [RFC2132] */ dhcp_code_RLP_Server= 11 ,/**< RLP Server N N/4 RLP Server addresses [RFC2132] */
dhcp_tag_Hostname= 12 ,/**< Hostname N Hostname string [RFC2132] */ dhcp_code_Hostname= 12 ,/**< Hostname N Hostname string [RFC2132] */
dhcp_tag_Boot_File_Size= 13 ,/**< Boot File Size 2 Size of boot file in 512 byte chunks [RFC2132] */ dhcp_code_Boot_File_Size= 13 ,/**< Boot File Size 2 Size of boot file in 512 byte chunks [RFC2132] */
dhcp_tag_Merit_Dump_File= 14 ,/**< Merit Dump File N Client to dump and name the file to dump it to [RFC2132] */ dhcp_code_Merit_Dump_File= 14 ,/**< Merit Dump File N Client to dump and name the file to dump it to [RFC2132] */
dhcp_tag_Domain_Name= 15 ,/**< Domain Name N The DNS domain name of the client [RFC2132] */ dhcp_code_Domain_Name= 15 ,/**< Domain Name N The DNS domain name of the client [RFC2132] */
dhcp_tag_Swap_Server= 16 ,/**< Swap Server N Swap Server address [RFC2132] */ dhcp_code_Swap_Server= 16 ,/**< Swap Server N Swap Server address [RFC2132] */
dhcp_tag_Root_Path= 17 ,/**< Root Path N Path name for root disk [RFC2132] */ dhcp_code_Root_Path= 17 ,/**< Root Path N Path name for root disk [RFC2132] */
dhcp_tag_Extension_File= 18 ,/**< Extension File N Path name for more BOOTP info [RFC2132] */ dhcp_code_Extension_File= 18 ,/**< Extension File N Path name for more BOOTP info [RFC2132] */
dhcp_tag_Forward_On_Off= 19 ,/**< Forward On/Off 1 Enable/Disable IP Forwarding [RFC2132] */ dhcp_code_Forward_On_Off= 19 ,/**< Forward On/Off 1 Enable/Disable IP Forwarding [RFC2132] */
dhcp_tag_SrcRte_On_Off = 20 ,/**< SrcRte On/Off 1 Enable/Disable Source Routing [RFC2132] */ dhcp_code_SrcRte_On_Off = 20 ,/**< SrcRte On/Off 1 Enable/Disable Source Routing [RFC2132] */
dhcp_tag_Policy_Filter= 21 ,/**< Policy Filter N Routing Policy Filters [RFC2132] */ dhcp_code_Policy_Filter= 21 ,/**< Policy Filter N Routing Policy Filters [RFC2132] */
dhcp_tag_Max_DG_Assembly= 22 ,/**< Max DG Assembly 2 Max Datagram Reassembly Size [RFC2132] */ dhcp_code_Max_DG_Assembly= 22 ,/**< Max DG Assembly 2 Max Datagram Reassembly Size [RFC2132] */
dhcp_tag_Default_IP_TTL= 23 ,/**< Default IP TTL 1 Default IP Time to Live [RFC2132] */ dhcp_code_Default_IP_TTL= 23 ,/**< Default IP TTL 1 Default IP Time to Live [RFC2132] */
dhcp_tag_MTU_Timeout= 24 ,/**< MTU Timeout 4 Path MTU Aging Timeout [RFC2132] */ dhcp_code_MTU_Timeout= 24 ,/**< MTU Timeout 4 Path MTU Aging Timeout [RFC2132] */
dhcp_tag_MTU_Plateau= 25 ,/**< MTU Plateau N Path MTU Plateau Table [RFC2132] */ dhcp_code_MTU_Plateau= 25 ,/**< MTU Plateau N Path MTU Plateau Table [RFC2132] */
dhcp_tag_MTU_Interface= 26 ,/**< MTU Interface 2 Interface MTU Size [RFC2132] */ dhcp_code_MTU_Interface= 26 ,/**< MTU Interface 2 Interface MTU Size [RFC2132] */
dhcp_tag_MTU_Subnet= 27 ,/**< MTU Subnet 1 All Subnets are Local [RFC2132] */ dhcp_code_MTU_Subnet= 27 ,/**< MTU Subnet 1 All Subnets are Local [RFC2132] */
dhcp_tag_Broadcast_Address= 28 ,/**< Broadcast Address 4 Broadcast Address [RFC2132] */ dhcp_code_Broadcast_Address= 28 ,/**< Broadcast Address 4 Broadcast Address [RFC2132] */
dhcp_tag_Mask_Discovery= 29 ,/**< Mask Discovery 1 Perform Mask Discovery [RFC2132] */ dhcp_code_Mask_Discovery= 29 ,/**< Mask Discovery 1 Perform Mask Discovery [RFC2132] */
dhcp_tag_Mask_Supplier= 30 ,/**< Mask Supplier 1 Provide Mask to Others [RFC2132] */ dhcp_code_Mask_Supplier= 30 ,/**< Mask Supplier 1 Provide Mask to Others [RFC2132] */
dhcp_tag_Router_Discovery= 31 ,/**< Router Discovery 1 Perform Router Discovery [RFC2132] */ dhcp_code_Router_Discovery= 31 ,/**< Router Discovery 1 Perform Router Discovery [RFC2132] */
dhcp_tag_Router_Request= 32 ,/**< Router Request 4 Router Solicitation Address [RFC2132] */ dhcp_code_Router_Request= 32 ,/**< Router Request 4 Router Solicitation Address [RFC2132] */
dhcp_tag_Static_Route= 33 ,/**< Static Route N Static Routing Table [RFC2132] */ dhcp_code_Static_Route= 33 ,/**< Static Route N Static Routing Table [RFC2132] */
dhcp_tag_Trailers= 34 ,/**< Trailers 1 Trailer Encapsulation [RFC2132] */ dhcp_code_Trailers= 34 ,/**< Trailers 1 Trailer Encapsulation [RFC2132] */
dhcp_tag_ARP_Timeout= 35 ,/**< ARP Timeout 4 ARP Cache Timeout [RFC2132] */ dhcp_code_ARP_Timeout= 35 ,/**< ARP Timeout 4 ARP Cache Timeout [RFC2132] */
dhcp_tag_Ethernet= 36 ,/**< Ethernet 1 Ethernet Encapsulation [RFC2132] */ dhcp_code_Ethernet= 36 ,/**< Ethernet 1 Ethernet Encapsulation [RFC2132] */
dhcp_tag_Default_TCP_TTL= 37 ,/**< Default TCP TTL 1 Default TCP Time to Live [RFC2132] */ dhcp_code_Default_TCP_TTL= 37 ,/**< Default TCP TTL 1 Default TCP Time to Live [RFC2132] */
dhcp_tag_Keepalive_Time= 38 ,/**< Keepalive Time 4 TCP Keepalive Interval [RFC2132] */ dhcp_code_Keepalive_Time= 38 ,/**< Keepalive Time 4 TCP Keepalive Interval [RFC2132] */
dhcp_tag_Keepalive_Data= 39 ,/**< Keepalive Data 1 TCP Keepalive Garbage [RFC2132] */ dhcp_code_Keepalive_Data= 39 ,/**< Keepalive Data 1 TCP Keepalive Garbage [RFC2132] */
dhcp_tag_NIS_Domain= 40 ,/**< NIS Domain N NIS Domain Name [RFC2132] */ dhcp_code_NIS_Domain= 40 ,/**< NIS Domain N NIS Domain Name [RFC2132] */
dhcp_tag_NIS_Servers= 41 ,/**< NIS Servers N NIS Server Addresses [RFC2132] */ dhcp_code_NIS_Servers= 41 ,/**< NIS Servers N NIS Server Addresses [RFC2132] */
dhcp_tag_NTP_Servers= 42 ,/**< NTP Servers N NTP Server Addresses [RFC2132] */ dhcp_code_NTP_Servers= 42 ,/**< NTP Servers N NTP Server Addresses [RFC2132] */
dhcp_tag_Vendor_Specific= 43 ,/**< Vendor Specific N Vendor Specific Information [RFC2132] */ dhcp_code_Vendor_Specific= 43 ,/**< Vendor Specific N Vendor Specific Information [RFC2132] */
dhcp_tag_NETBIOS_Name_Srv= 44 ,/**< NETBIOS Name Srv N NETBIOS Name Servers [RFC2132] */ dhcp_code_NETBIOS_Name_Srv= 44 ,/**< NETBIOS Name Srv N NETBIOS Name Servers [RFC2132] */
dhcp_tag_NETBIOS_Dist_Srv= 45 ,/**< NETBIOS Dist Srv N NETBIOS Datagram Distribution [RFC2132] */ dhcp_code_NETBIOS_Dist_Srv= 45 ,/**< NETBIOS Dist Srv N NETBIOS Datagram Distribution [RFC2132] */
dhcp_tag_NETBIOS_Node_Type= 46 ,/**< NETBIOS Node Type 1 NETBIOS Node Type [RFC2132] */ dhcp_code_NETBIOS_Node_Type= 46 ,/**< NETBIOS Node Type 1 NETBIOS Node Type [RFC2132] */
dhcp_tag_NETBIOS_Scope= 47 ,/**< NETBIOS Scope N NETBIOS Scope [RFC2132] */ dhcp_code_NETBIOS_Scope= 47 ,/**< NETBIOS Scope N NETBIOS Scope [RFC2132] */
dhcp_tag_X_Window_Font= 48 ,/**< X Window Font N X Window Font Server [RFC2132] */ dhcp_code_X_Window_Font= 48 ,/**< X Window Font N X Window Font Server [RFC2132] */
dhcp_tag_X_Window_Manager= 49 ,/**< X Window Manager N X Window Display Manager [RFC2132] */ dhcp_code_X_Window_Manager= 49 ,/**< X Window Manager N X Window Display Manager [RFC2132] */
dhcp_tag_Address_Request= 50 ,/**< Address Request 4 Requested IP Address [RFC2132] */ dhcp_code_Address_Request= 50 ,/**< Address Request 4 Requested IP Address [RFC2132] */
dhcp_tag_Address_Time= 51 ,/**< Address Time 4 IP Address Lease Time [RFC2132] */ dhcp_code_Address_Time= 51 ,/**< Address Time 4 IP Address Lease Time [RFC2132] */
dhcp_tag_Overload= 52 ,/**< Overload 1 Overload "sname" or "file" [RFC2132] */ dhcp_code_Overload= 52 ,/**< Overload 1 Overload "sname" or "file" [RFC2132] */
dhcp_tag_DHCP_Msg_Type= 53 ,/**< DHCP Msg Type 1 DHCP Message Type [RFC2132] */ dhcp_code_DHCP_Msg_Type= 53 ,/**< DHCP Msg Type 1 DHCP Message Type [RFC2132] */
dhcp_tag_DHCP_Server_Id= 54 ,/**< DHCP Server Id 4 DHCP Server Identification [RFC2132] */ dhcp_code_DHCP_Server_Id= 54 ,/**< DHCP Server Id 4 DHCP Server Identification [RFC2132] */
dhcp_tag_Parameter_List= 55 ,/**< Parameter List N Parameter Request List [RFC2132] */ dhcp_code_Parameter_List= 55 ,/**< Parameter List N Parameter Request List [RFC2132] */
dhcp_tag_DHCP_Error_Message= 56 ,/**< DHCP Message N DHCP Error Message [RFC2132] */ dhcp_code_DHCP_Error_Message= 56 ,/**< DHCP Message N DHCP Error Message [RFC2132] */
dhcp_tag_DHCP_Max_Msg_Size= 57 ,/**< DHCP Max Msg Size 2 DHCP Maximum Message Size [RFC2132] */ dhcp_code_DHCP_Max_Msg_Size= 57 ,/**< DHCP Max Msg Size 2 DHCP Maximum Message Size [RFC2132] */
dhcp_tag_Renewal_Time= 58 ,/**< Renewal Time 4 DHCP Renewal (T1) Time [RFC2132] */ dhcp_code_Renewal_Time= 58 ,/**< Renewal Time 4 DHCP Renewal (T1) Time [RFC2132] */
dhcp_tag_Rebinding_Time= 59 ,/**< Rebinding Time 4 DHCP Rebinding (T2) Time [RFC2132] */ dhcp_code_Rebinding_Time= 59 ,/**< Rebinding Time 4 DHCP Rebinding (T2) Time [RFC2132] */
dhcp_tag_Class_Id= 60 ,/**< Class Id N Class Identifier [RFC2132] */ dhcp_code_Class_Id= 60 ,/**< Class Id N Class Identifier [RFC2132] */
dhcp_tag_Client_Id= 61 ,/**< Client Id N Client Identifier [RFC2132] */ dhcp_code_Client_Id= 61 ,/**< Client Id N Client Identifier [RFC2132] */
dhcp_tag_NetWare_IP_Domain= 62 ,/**< NetWare/IP Domain N NetWare/IP Domain Name [RFC2242] */ dhcp_code_NetWare_IP_Domain= 62 ,/**< NetWare/IP Domain N NetWare/IP Domain Name [RFC2242] */
dhcp_tag_NetWare_IP_Option= 63 ,/**< NetWare/IP Option N NetWare/IP sub Options [RFC2242] */ dhcp_code_NetWare_IP_Option= 63 ,/**< NetWare/IP Option N NetWare/IP sub Options [RFC2242] */
dhcp_tag_NIS_Domain_Name= 64 ,/**< NIS-Domain-Name N NIS+ v3 Client Domain Name [RFC2132] */ dhcp_code_NIS_Domain_Name= 64 ,/**< NIS-Domain-Name N NIS+ v3 Client Domain Name [RFC2132] */
dhcp_tag_NIS_Server_Addr = 65 ,/**< NIS-Server-Addr N NIS+ v3 Server Addresses [RFC2132] */ dhcp_code_NIS_Server_Addr = 65 ,/**< NIS-Server-Addr N NIS+ v3 Server Addresses [RFC2132] */
dhcp_tag_Server_Name= 66 ,/**< Server-Name N TFTP Server Name [RFC2132] */ dhcp_code_Server_Name= 66 ,/**< Server-Name N TFTP Server Name [RFC2132] */
dhcp_tag_Bootfile_Name= 67 ,/**< Bootfile-Name N Boot File Name [RFC2132] */ dhcp_code_Bootfile_Name= 67 ,/**< Bootfile-Name N Boot File Name [RFC2132] */
dhcp_tag_Home_Agent_Addrs= 68 ,/**< Home-Agent-Addrs N Home Agent Addresses [RFC2132] */ dhcp_code_Home_Agent_Addrs= 68 ,/**< Home-Agent-Addrs N Home Agent Addresses [RFC2132] */
dhcp_tag_SMTP_Server= 69 ,/**< SMTP-Server N Simple Mail Server Addresses [RFC2132] */ dhcp_code_SMTP_Server= 69 ,/**< SMTP-Server N Simple Mail Server Addresses [RFC2132] */
dhcp_tag_POP3_Server= 70 ,/**< POP3-Server N Post Office Server Addresses [RFC2132] */ dhcp_code_POP3_Server= 70 ,/**< POP3-Server N Post Office Server Addresses [RFC2132] */
dhcp_tag_NNTP_Server= 71 ,/**< NNTP-Server N Network News Server Addresses [RFC2132] */ dhcp_code_NNTP_Server= 71 ,/**< NNTP-Server N Network News Server Addresses [RFC2132] */
dhcp_tag_WWW_Server= 72 ,/**< WWW-Server N WWW Server Addresses [RFC2132] */ dhcp_code_WWW_Server= 72 ,/**< WWW-Server N WWW Server Addresses [RFC2132] */
dhcp_tag_Finger_Server= 73 ,/**< Finger-Server N Finger Server Addresses [RFC2132] */ dhcp_code_Finger_Server= 73 ,/**< Finger-Server N Finger Server Addresses [RFC2132] */
dhcp_tag_IRC_Server= 74 ,/**< IRC-Server N Chat Server Addresses [RFC2132] */ dhcp_code_IRC_Server= 74 ,/**< IRC-Server N Chat Server Addresses [RFC2132] */
dhcp_tag_StreetTalk_Server= 75 ,/**< StreetTalk-Server N StreetTalk Server Addresses [RFC2132] */ dhcp_code_StreetTalk_Server= 75 ,/**< StreetTalk-Server N StreetTalk Server Addresses [RFC2132] */
dhcp_tag_STDA_Server= 76 ,/**< STDA-Server N ST Directory Assist. Addresses [RFC2132] */ dhcp_code_STDA_Server= 76 ,/**< STDA-Server N ST Directory Assist. Addresses [RFC2132] */
dhcp_tag_User_Class= 77 ,/**< User-Class N User Class Information [RFC3004] */ dhcp_code_User_Class= 77 ,/**< User-Class N User Class Information [RFC3004] */
dhcp_tag_Directory_Agent = 78 ,/**< Directory Agent N directory agent information [RFC2610] */ dhcp_code_Directory_Agent = 78 ,/**< Directory Agent N directory agent information [RFC2610] */
dhcp_tag_Service_Scope = 79 ,/**< Service Scope N service location agent scope [RFC2610] */ dhcp_code_Service_Scope = 79 ,/**< Service Scope N service location agent scope [RFC2610] */
dhcp_tag_Rapid_Commit= 80 ,/**< Rapid Commit 0 Rapid Commit [RFC4039] */ dhcp_code_Rapid_Commit= 80 ,/**< Rapid Commit 0 Rapid Commit [RFC4039] */
dhcp_tag_Client_FQDN = 81 ,/**< Client FQDN N Fully Qualified Domain Name [RFC4702] */ dhcp_code_Client_FQDN = 81 ,/**< Client FQDN N Fully Qualified Domain Name [RFC4702] */
dhcp_tag_Relay_Agent_Information= 82 ,/**< Relay Agent Information N Relay Agent Information [RFC3046] */ dhcp_code_Relay_Agent_Information= 82 ,/**< Relay Agent Information N Relay Agent Information [RFC3046] */
dhcp_tag_iSNS= 83 ,/**< iSNS N Internet Storage Name Service [RFC4174] */ dhcp_code_iSNS= 83 ,/**< iSNS N Internet Storage Name Service [RFC4174] */
//84 REMOVED/Unassigned [RFC3679] */ //84 REMOVED/Unassigned [RFC3679] */
dhcp_tag_NDS_Servers= 85 ,/**< NDS Servers N Novell Directory Services [RFC2241] */ dhcp_code_NDS_Servers= 85 ,/**< NDS Servers N Novell Directory Services [RFC2241] */
dhcp_tag_NDS_Tree_Name= 86 ,/**< NDS Tree Name N Novell Directory Services [RFC2241] */ dhcp_code_NDS_Tree_Name= 86 ,/**< NDS Tree Name N Novell Directory Services [RFC2241] */
dhcp_tag_NDS_Context= 87 ,/**< NDS Context N Novell Directory Services [RFC2241] */ dhcp_code_NDS_Context= 87 ,/**< NDS Context N Novell Directory Services [RFC2241] */
dhcp_tag_BCMCS_Controller_Domain_Name_list= 88 ,/**< BCMCS Controller Domain Name list [RFC4280] */ dhcp_code_BCMCS_Controller_Domain_Name_list= 88 ,/**< BCMCS Controller Domain Name list [RFC4280] */
dhcp_tag_BCMCS_Controller_IPv4_address_option= 89 ,/**< BCMCS Controller IPv4 address option [RFC4280] */ dhcp_code_BCMCS_Controller_IPv4_address_option= 89 ,/**< BCMCS Controller IPv4 address option [RFC4280] */
dhcp_tag_Authentication= 90 ,/**< Authentication N Authentication [RFC3118] */ dhcp_code_Authentication= 90 ,/**< Authentication N Authentication [RFC3118] */
dhcp_tag_client_last_transaction_time= 91 ,/**< client-last-transaction-time option [RFC4388] */ dhcp_code_client_last_transaction_time= 91 ,/**< client-last-transaction-time option [RFC4388] */
dhcp_tag_associated_ip= 92 ,/**< associated-ip option [RFC4388] */ dhcp_code_associated_ip= 92 ,/**< associated-ip option [RFC4388] */
dhcp_tag_Client_System = 93 ,/**< Client System N Client System Architecture [RFC4578] */ dhcp_code_Client_System = 93 ,/**< Client System N Client System Architecture [RFC4578] */
dhcp_tag_Client_NDI = 94 ,/**< Client NDI N Client Network Device Interface [RFC4578] */ dhcp_code_Client_NDI = 94 ,/**< Client NDI N Client Network Device Interface [RFC4578] */
dhcp_tag_LDAP= 95 ,/**< LDAP N Lightweight Directory Access Protocol [RFC3679] */ dhcp_code_LDAP= 95 ,/**< LDAP N Lightweight Directory Access Protocol [RFC3679] */
dhcp_tag_REMOVED_Unassigned= 96 ,/**< REMOVED/Unassigned [RFC3679] */ dhcp_code_REMOVED_Unassigned= 96 ,/**< REMOVED/Unassigned [RFC3679] */
dhcp_tag_UUID_GUID= 97 ,/**< UUID/GUID N UUID/GUID-based Client Identifier [RFC4578] */ dhcp_code_UUID_GUID= 97 ,/**< UUID/GUID N UUID/GUID-based Client Identifier [RFC4578] */
dhcp_tag_User_Auth= 98 ,/**< User-Auth N Open Group's User Authentication [RFC2485] */ dhcp_code_User_Auth= 98 ,/**< User-Auth N Open Group's User Authentication [RFC2485] */
dhcp_tag_GEOCONF_CIVIC= 99 ,/**< GEOCONF_CIVIC [RFC4776] */ dhcp_code_GEOCONF_CIVIC= 99 ,/**< GEOCONF_CIVIC [RFC4776] */
dhcp_tag_PCode= 100 ,/**< PCode N IEEE 1003.1 TZ String [RFC4833] */ dhcp_code_PCode= 100 ,/**< PCode N IEEE 1003.1 TZ String [RFC4833] */
dhcp_tag_TCode= 101 ,/**< TCode N Reference to the TZ Database [RFC4833] */ dhcp_code_TCode= 101 ,/**< TCode N Reference to the TZ Database [RFC4833] */
//102-107 REMOVED/Unassigned [RFC3679] //102-107 REMOVED/Unassigned [RFC3679]
//108 REMOVED/Unassigned [RFC3679] //108 REMOVED/Unassigned [RFC3679]
//109 Unassigned [RFC3679] //109 Unassigned [RFC3679]
//110 REMOVED/Unassigned [RFC3679] //110 REMOVED/Unassigned [RFC3679]
//111 Unassigned [RFC3679] //111 Unassigned [RFC3679]
dhcp_tag_Netinfo_Address= 112 ,/**< Netinfo Address N NetInfo Parent Server Address [RFC3679] */ dhcp_code_Netinfo_Address= 112 ,/**< Netinfo Address N NetInfo Parent Server Address [RFC3679] */
dhcp_tag_Netinfo_Tag= 113 ,/**< Netinfo Tag N NetInfo Parent Server Tag [RFC3679] */ dhcp_code_Netinfo_Tag= 113 ,/**< Netinfo Tag N NetInfo Parent Server Tag [RFC3679] */
dhcp_tag_= 114 ,/**< URL N URL [RFC3679] */ dhcp_code_= 114 ,/**< URL N URL [RFC3679] */
//115 REMOVED/Unassigned [RFC3679] //115 REMOVED/Unassigned [RFC3679]
dhcp_tag_Auto_Config= 116 ,/**< Auto-Config N DHCP Auto-Configuration [RFC2563] */ dhcp_code_Auto_Config= 116 ,/**< Auto-Config N DHCP Auto-Configuration [RFC2563] */
dhcp_tag_Name_Service_Search= 117 ,/**< Name Service Search N Name Service Search [RFC2937] */ dhcp_code_Name_Service_Search= 117 ,/**< Name Service Search N Name Service Search [RFC2937] */
dhcp_tag_Subnet_Selection_Option= 118 ,/**< Subnet Selection Option 4 Subnet Selection Option [RFC3011] */ dhcp_code_Subnet_Selection_Option= 118 ,/**< Subnet Selection Option 4 Subnet Selection Option [RFC3011] */
dhcp_tag_Domain_Search= 119 ,/**< Domain Search N DNS domain search list [RFC3397] */ dhcp_code_Domain_Search= 119 ,/**< Domain Search N DNS domain search list [RFC3397] */
dhcp_tag_SIP_Servers_DHCP_Option= 120 ,/**< SIP Servers DHCP Option N SIP Servers DHCP Option [RFC3361] */ dhcp_code_SIP_Servers_DHCP_Option= 120 ,/**< SIP Servers DHCP Option N SIP Servers DHCP Option [RFC3361] */
dhcp_tag_Classless_Static_Route_Option= 121 ,/**< Classless Static Route Option N Classless Static Route Option [RFC3442] */ dhcp_code_Classless_Static_Route_Option= 121 ,/**< Classless Static Route Option N Classless Static Route Option [RFC3442] */
dhcp_tag_CCC= 122 ,/**< CCC N CableLabs Client Configuration [RFC3495] */ dhcp_code_CCC= 122 ,/**< CCC N CableLabs Client Configuration [RFC3495] */
dhcp_tag_GeoConf_Option= 123 ,/**< GeoConf Option 16 GeoConf Option [RFC3825] */ dhcp_code_GeoConf_Option= 123 ,/**< GeoConf Option 16 GeoConf Option [RFC3825] */
dhcp_tag_V_I_Vendor_Class= 124 ,/**< V-I Vendor Class Vendor-Identifying Vendor Class [RFC3925] */ dhcp_code_V_I_Vendor_Class= 124 ,/**< V-I Vendor Class Vendor-Identifying Vendor Class [RFC3925] */
dhcp_tag_V_I_Vendor_Specific_Information= 125 ,/**< V-I Vendor-Specific Information Vendor-Identifying Vendor-Specific Information [RFC3925] */ dhcp_code_V_I_Vendor_Specific_Information= 125 ,/**< V-I Vendor-Specific Information Vendor-Identifying Vendor-Specific Information [RFC3925] */
//dhcp_tag_= 126 ,/**< Removed/Unassigned [RFC3679] */ //dhcp_code_= 126 ,/**< Removed/Unassigned [RFC3679] */
//dhcp_tag_= 127 ,/**< Removed/Unassigned [RFC3679] */ //dhcp_code_= 127 ,/**< Removed/Unassigned [RFC3679] */
//dhcp_tag_PXE - undefined= 128 ,/**< PXE - undefined (vendor specific) [RFC4578] */ //dhcp_code_PXE - undefined= 128 ,/**< PXE - undefined (vendor specific) [RFC4578] */
dhcp_tag_Etherboot_signature= 128 ,/**< Etherboot signature. 6 bytes: E4:45:74:68:00:00 */ dhcp_code_Etherboot_signature= 128 ,/**< Etherboot signature. 6 bytes: E4:45:74:68:00:00 */
dhcp_tag_DOCSIS= 128 ,/**< DOCSIS "full security" server IP address */ dhcp_code_DOCSIS= 128 ,/**< DOCSIS "full security" server IP address */
dhcp_tag_TFTP_Server_IP= 128 ,/**< TFTP Server IP address (for IP Phone software load) */ dhcp_code_TFTP_Server_IP= 128 ,/**< TFTP Server IP address (for IP Phone software load) */
//dhcp_tag_= 129 ,/**< PXE - undefined (vendor specific) [RFC4578] */ //dhcp_code_= 129 ,/**< PXE - undefined (vendor specific) [RFC4578] */
dhcp_tag_Kernel_options= 129 ,/**< Kernel options. Variable length string */ dhcp_code_Kernel_options= 129 ,/**< Kernel options. Variable length string */
dhcp_tag_Call_Server_IP= 129 ,/**< Call Server IP address */ dhcp_code_Call_Server_IP= 129 ,/**< Call Server IP address */
//dhcp_tag_= 130 ,/**< PXE - undefined (vendor specific) [RFC4578] */ //dhcp_code_= 130 ,/**< PXE - undefined (vendor specific) [RFC4578] */
dhcp_tag_Ethernet_interface= 130 ,/**< Ethernet interface. Variable length string. */ dhcp_code_Ethernet_interface= 130 ,/**< Ethernet interface. Variable length string. */
dhcp_tag_Discrimination= 130 ,/**< Discrimination string (to identify vendor) */ dhcp_code_Discrimination= 130 ,/**< Discrimination string (to identify vendor) */
//dhcp_tag_= 131 ,/**< PXE - undefined (vendor specific) [RFC4578] */ //dhcp_code_= 131 ,/**< PXE - undefined (vendor specific) [RFC4578] */
dhcp_tag_Remote_statistics_server_IP= 131 ,/**< Remote statistics server IP address */ dhcp_code_Remote_statistics_server_IP= 131 ,/**< Remote statistics server IP address */
//dhcp_tag_= 132 ,/**< PXE - undefined (vendor specific) [RFC4578] */ //dhcp_code_= 132 ,/**< PXE - undefined (vendor specific) [RFC4578] */
dhcp_tag_IEEE_802_1Q_VLAN_ID= 132 ,/**< IEEE 802.1Q VLAN ID */ dhcp_code_IEEE_802_1Q_VLAN_ID= 132 ,/**< IEEE 802.1Q VLAN ID */
//dhcp_tag_= 133 ,/**< PXE - undefined (vendor specific) [RFC4578] */ //dhcp_code_= 133 ,/**< PXE - undefined (vendor specific) [RFC4578] */
dhcp_tag_IEEE_802_1D_p= 133 ,/**< IEEE 802.1D/p Layer 2 Priority */ dhcp_code_IEEE_802_1D_p= 133 ,/**< IEEE 802.1D/p Layer 2 Priority */
//dhcp_tag_= 134 ,/**< PXE - undefined (vendor specific) [RFC4578] */ //dhcp_code_= 134 ,/**< PXE - undefined (vendor specific) [RFC4578] */
dhcp_tag_DSCP= 134 ,/**< Diffserv Code Point (DSCP) for VoIP signalling and media streams */ dhcp_code_DSCP= 134 ,/**< Diffserv Code Point (DSCP) for VoIP signalling and media streams */
//dhcp_tag_= 135 ,/**< PXE - undefined (vendor specific) [RFC4578] */ //dhcp_code_= 135 ,/**< PXE - undefined (vendor specific) [RFC4578] */
dhcp_tag_HTTP_Proxy= 135 ,/**< HTTP Proxy for phone-specific applications */ dhcp_code_HTTP_Proxy= 135 ,/**< HTTP Proxy for phone-specific applications */
dhcp_tag_OPTION_PANA_AGENT= 136 ,/**< OPTION_PANA_AGENT [RFC5192] */ dhcp_code_OPTION_PANA_AGENT= 136 ,/**< OPTION_PANA_AGENT [RFC5192] */
dhcp_tag_OPTION_V4_LOST= 137 ,/**< OPTION_V4_LOST [RFC5223] */ dhcp_code_OPTION_V4_LOST= 137 ,/**< OPTION_V4_LOST [RFC5223] */
dhcp_tag_OPTION_CAPWAP_AC_V4= 138 ,/**< OPTION_CAPWAP_AC_V4 N CAPWAP Access Controller addresses [RFC5417] */ dhcp_code_OPTION_CAPWAP_AC_V4= 138 ,/**< OPTION_CAPWAP_AC_V4 N CAPWAP Access Controller addresses [RFC5417] */
dhcp_tag_OPTION_IPv4_Address_MoS= 139 ,/**< OPTION-IPv4_Address-MoS N a series of suboptions [RFC5678] */ dhcp_code_OPTION_IPv4_Address_MoS= 139 ,/**< OPTION-IPv4_Address-MoS N a series of suboptions [RFC5678] */
dhcp_tag_OPTION_IPv4_FQDN_MoS= 140 ,/**< OPTION-IPv4_FQDN-MoS N a series of suboptions [RFC5678] */ dhcp_code_OPTION_IPv4_FQDN_MoS= 140 ,/**< OPTION-IPv4_FQDN-MoS N a series of suboptions [RFC5678] */
//141-149 Unassigned [RFC3942] */ //141-149 Unassigned [RFC3942] */
dhcp_tag_TFTP_server_address= 150 ,/**< TFTP server address (Tentatively Assigned - 2005-06-23) */ dhcp_code_TFTP_server_address= 150 ,/**< TFTP server address (Tentatively Assigned - 2005-06-23) */
dhcp_tag_Etherboot= 150 ,/**< Etherboot */ dhcp_code_Etherboot= 150 ,/**< Etherboot */
dhcp_tag_GRUB_configuration_path_name= 150 ,/**< GRUB configuration path name */ dhcp_code_GRUB_configuration_path_name= 150 ,/**< GRUB configuration path name */
//151-174 Unassigned [RFC3942] //151-174 Unassigned [RFC3942]
//dhcp_tag_Etherboot= 175 ,/**< Etherboot (Tentatively Assigned - 2005-06-23) */ //dhcp_code_Etherboot= 175 ,/**< Etherboot (Tentatively Assigned - 2005-06-23) */
dhcp_tag_IP_Telephone= 176 ,/**< IP Telephone (Tentatively Assigned - 2005-06-23) */ dhcp_code_IP_Telephone= 176 ,/**< IP Telephone (Tentatively Assigned - 2005-06-23) */
//dhcp_tag_Etherboot= 177 ,/**< Etherboot (Tentatively Assigned - 2005-06-23) */ //dhcp_code_Etherboot= 177 ,/**< Etherboot (Tentatively Assigned - 2005-06-23) */
dhcp_tag_PacketCable_and_CableHome= 177 ,/**< PacketCable and CableHome (replaced by 122) */ dhcp_code_PacketCable_and_CableHome= 177 ,/**< PacketCable and CableHome (replaced by 122) */
//178-207 Unassigned [RFC3942] //178-207 Unassigned [RFC3942]
dhcp_tag_PXELINUX_Magic= 208 ,/**< PXELINUX Magic 4 magic string = F1:00:74:7E [RFC5071] Deprecated */ dhcp_code_PXELINUX_Magic= 208 ,/**< PXELINUX Magic 4 magic string = F1:00:74:7E [RFC5071] Deprecated */
dhcp_tag_Configuration_File= 209 ,/**< Configuration File N Configuration file [RFC5071] */ dhcp_code_Configuration_File= 209 ,/**< Configuration File N Configuration file [RFC5071] */
dhcp_tag_Path_Prefix= 210 ,/**< Path Prefix N Path Prefix Option [RFC5071] */ dhcp_code_Path_Prefix= 210 ,/**< Path Prefix N Path Prefix Option [RFC5071] */
dhcp_tag_Reboot_Time = 211 ,/**< Reboot Time 4 Reboot Time [RFC5071] */ dhcp_code_Reboot_Time = 211 ,/**< Reboot Time 4 Reboot Time [RFC5071] */
// 212-219 Unassigned // 212-219 Unassigned
dhcp_tag_Subnet_Allocation= 220 ,/**< Subnet Allocation Option (Tentatively Assigned - 2005-06-23) */ dhcp_code_Subnet_Allocation= 220 ,/**< Subnet Allocation Option (Tentatively Assigned - 2005-06-23) */
dhcp_tag_Virtual_Subnet= 221 ,/**< Virtual Subnet Selection Option (Tentatively Assigned - 2005-06-23) */ dhcp_code_Virtual_Subnet= 221 ,/**< Virtual Subnet Selection Option (Tentatively Assigned - 2005-06-23) */
// 222-223 Unassigned [RFC3942] // 222-223 Unassigned [RFC3942]
//224-254 Reserved (Private Use) //224-254 Reserved (Private Use)
dhcp_tag_null=224 , dhcp_code_null=224 ,
dhcp_tag_End= 255 ,/**< End 0 None [RFC2132] */ dhcp_code_End= 255 ,/**< End 0 None [RFC2132] */
} }
tnet_dhcp_option_tag_t; tnet_dhcp_option_code_t;
/** DHCP/BOOTP option as per RFC 2132. /** DHCP/BOOTP option as per RFC 2132.
* Format ==> subclause 2. * Format ==> subclause 2.
@ -222,22 +223,53 @@ typedef struct tnet_dhcp_option_s
TSK_DECLARE_OBJECT; TSK_DECLARE_OBJECT;
unsigned initialized:1; unsigned initialized:1;
tnet_dhcp_option_tag_t tag; /**< 1-byte option-tag. */ tnet_dhcp_option_code_t code; /**< 1-byte option-code. */
uint8_t length; tsk_buffer_t *value;
tsk_buffer_t *data;
} }
tnet_dhcp_option_t; tnet_dhcp_option_t;
typedef tsk_list_t tnet_dhcp_options_L_t; typedef tsk_list_t tnet_dhcp_options_L_t;
#define TNET_DECLARE_HCP_OPTION tnet_dhcp_option_t dhcp_option #define TNET_DECLARE_DHCP_OPTION tnet_dhcp_option_t dhcp_option
int tnet_dhcp_option_init(tnet_dhcp_option_t *option, tnet_dhcp_option_tag_t tag); int tnet_dhcp_option_init(tnet_dhcp_option_t *option, tnet_dhcp_option_code_t code);
int tnet_dhcp_option_deinit(tnet_dhcp_option_t *option); int tnet_dhcp_option_deinit(tnet_dhcp_option_t *option);
tnet_dhcp_option_t* tnet_dhcp_option_deserialize(const void* data, size_t size); tnet_dhcp_option_t* tnet_dhcp_option_deserialize(const void* data, size_t size);
int tnet_dhcp_option_serialize(const tnet_dhcp_option_t* option, tsk_buffer_t *output); int tnet_dhcp_option_serialize(const tnet_dhcp_option_t* option, tsk_buffer_t *output);
int tnet_dhcp_option_serializeex(tnet_dhcp_option_code_t code, uint8_t length, const void* value, tsk_buffer_t *output);
/** Parameter Request List */
typedef struct tnet_dhcp_option_paramslist_s
{
TNET_DECLARE_DHCP_OPTION;
/* RFC 2132 - 9.8. Parameter Request List
Code Len Option Codes
+-----+-----+-----+-----+---
| 55 | n | c1 | c2 | ...
+-----+-----+-----+-----+---
*/
}
tnet_dhcp_option_paramslist_t;
int tnet_dhcp_option_paramslist_add_code(tnet_dhcp_option_paramslist_t* self, tnet_dhcp_option_code_t code);
TINYNET_GEXTERN const void *tnet_dns_ns_def_t;
TINYNET_GEXTERN const void *tnet_dhcp_option_paramslist_def_t;
TINYNET_GEXTERN const void *tnet_dhcp_option_def_t; TINYNET_GEXTERN const void *tnet_dhcp_option_def_t;

View File

@ -515,6 +515,7 @@ int tnet_getnameinfo(const struct sockaddr *sa, socklen_t salen, char* node, soc
int tnet_gethostname(tnet_host_t* result) int tnet_gethostname(tnet_host_t* result)
{ {
return gethostname(*result, sizeof(*result)); return gethostname(*result, sizeof(*result));
} }

View File

@ -49,8 +49,8 @@
#define RUN_TEST_STUN 0 #define RUN_TEST_STUN 0
#define RUN_TEST_NAT 0 #define RUN_TEST_NAT 0
#define RUN_TEST_IFACES 0 #define RUN_TEST_IFACES 0
#define RUN_TEST_DNS 1 #define RUN_TEST_DNS 0
#define RUN_TEST_DHCP 0 #define RUN_TEST_DHCP 1
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
int _tmain(int argc, _TCHAR* argv[]) int _tmain(int argc, _TCHAR* argv[])

View File

@ -24,30 +24,34 @@
void test_dhcp_discover(tnet_dhcp_ctx_t *ctx) void test_dhcp_discover(tnet_dhcp_ctx_t *ctx)
{ {
tnet_dhcp_params_t *params = TNET_DHCP_PARAMS_CREATE(dhcp_tag_null); }
void test_dhcp_offer(tnet_dhcp_ctx_t *ctx)
{
}
void test_dhcp_request(tnet_dhcp_ctx_t *ctx)
{
}
void test_dhcp_inform(tnet_dhcp_ctx_t *ctx)
{
tnet_dhcp_params_t *params = 0;
tnet_dhcp_reply_t *reply = 0;
params = TNET_DHCP_PARAMS_CREATE();
tnet_dhcp_params_add_code(params, dhcp_code_SIP_Servers_DHCP_Option);
tnet_dhcp_reply_t *reply = tnet_dhcp_query(ctx, params); reply = tnet_dhcp_query_inform(ctx, params);
TSK_OBJECT_SAFE_FREE(reply); TSK_OBJECT_SAFE_FREE(reply);
TSK_OBJECT_SAFE_FREE(params); TSK_OBJECT_SAFE_FREE(params);
} }
void test_dhcp_offer()
{
}
void test_dhcp_request()
{
}
void test_dhcp_inform()
{
}
void test_dhcp() void test_dhcp()
{ {
tnet_dhcp_ctx_t *ctx = TNET_DHCP_CTX_CREATE(); tnet_dhcp_ctx_t *ctx = TNET_DHCP_CTX_CREATE();
test_dhcp_discover(ctx); test_dhcp_inform(ctx);
TSK_OBJECT_SAFE_FREE(ctx); TSK_OBJECT_SAFE_FREE(ctx);
} }

View File

@ -32,7 +32,7 @@
#include "tsk_debug.h" #include "tsk_debug.h"
#if defined (_DEBUG) #if defined (_DEBUG)
# define TSK_DEBUG_OBJECTS 1 # define TSK_DEBUG_OBJECTS 0
static int tsk_objects_count = 0; static int tsk_objects_count = 0;
#else #else
# define TSK_DEBUG_OBJECTS 0 # define TSK_DEBUG_OBJECTS 0

View File

@ -139,7 +139,7 @@ typedef struct tsip_dialog_s
tsip_uris_L_t *routes; tsip_uris_L_t *routes;
tsip_challenges_L_t *challenges; tsip_challenges_L_t *challenges;
tsip_dialog_event_callback callback; tsip_dialog_event_callback callback;
TSK_DECLARE_SAFEOBJ; TSK_DECLARE_SAFEOBJ;

View File

@ -35,22 +35,35 @@
TSIP_BEGIN_DECLS TSIP_BEGIN_DECLS
/**@def TSIP_HEADER_SERVICE_ROUTE_CREATE
* Creates new sip 'Service-Route' header. You must call @ref TSK_OBJECT_SAFE_FREE to free the header.
* @sa TSK_OBJECT_SAFE_FREE.
*/
#define TSIP_HEADER_SERVICE_ROUTE_VA_ARGS(service_route) tsip_header_Service_Route_def_t, (const char*)service_route
#define TSIP_HEADER_SERVICE_ROUTE_CREATE(service_route) tsk_object_new(TSIP_HEADER_SERVICE_ROUTE_VA_ARGS(service_route))
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
/// @struct /// @struct
/// ///
/// @brief SIP header 'Service-Route'. /// @brief SIP header 'Service-Route' as per RFC 3608.
/// @author Mamadou /// @author Mamadou
/// @date 12/3/2009 /// @date 12/3/2009
/// ///
/// @par ABNF /// @par ABNF: Service-Route = "Service-Route" HCOLON sr-value *(COMMA sr-value)
/// sr-value = name-addr *( SEMI rr-param )
/// ///
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct tsip_header_Service_Route_s typedef struct tsip_header_Service_Route_s
{ {
TSIP_DECLARE_HEADER; TSIP_DECLARE_HEADER;
char *value;
} }
tsip_header_Service_Route_t; tsip_header_Service_Route_t;
tsip_header_Service_Route_t *tsip_header_Service_Route_parse(const char *data, size_t size);
TINYSIP_GEXTERN const void *tsip_header_Service_Route_def_t;
TSIP_END_DECLS TSIP_END_DECLS
#endif /* _TSIP_HEADER_SERVICE_ROUTE_H_ */ #endif /* _TSIP_HEADER_SERVICE_ROUTE_H_ */

View File

@ -0,0 +1,158 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_header_Service_Route.c
* @brief SIP Service-Route header as per RFC 3608.
*
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
*
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/
#include "tinysip/headers/tsip_header_Service_Route.h"
#include "tinysip/parsers/tsip_parser_uri.h"
#include "tsk_debug.h"
#include "tsk_memory.h"
#include "tsk_time.h"
#include <string.h>
/**@defgroup tsip_header_Service_Route_group SIP Service-Route header.
*/
/***********************************
* Ragel state machine.
*/
%%{
machine tsip_machine_parser_header_Service_Route;
# Includes
include tsip_machine_utils "./tsip_machine_utils.rl";
action tag
{
tag_start = p;
}
action parse_route
{
PARSER_SET_STRING(hdr_service_route->value);
}
action eob
{
}
Service_Route = ( "Service-Route"i ) HCOLON any*>tag %parse_route;
# Entry point
main := Service_Route :>CRLF @eob;
}%%
int tsip_header_Service_Route_tostring(const void* header, tsk_buffer_t* output)
{
if(header)
{
const tsip_header_Service_Route_t *Service_Route = header;
if(Service_Route->value)
{
return tsk_buffer_append(output, Service_Route->value, strlen(Service_Route->value));
}
}
return -1;
}
tsip_header_Service_Route_t *tsip_header_Service_Route_parse(const char *data, size_t size)
{
int cs = 0;
const char *p = data;
const char *pe = p + size;
const char *eof = pe;
tsip_header_Service_Route_t *hdr_service_route = TSIP_HEADER_SERVICE_ROUTE_CREATE(0);
const char *tag_start;
%%write data;
%%write init;
%%write exec;
if( cs < %%{ write first_final; }%% )
{
TSK_OBJECT_SAFE_FREE(hdr_service_route);
}
return hdr_service_route;
}
//========================================================
// Service_Route header object definition
//
/**@ingroup tsip_header_Service_Route_group
*/
static void* tsip_header_Service_Route_create(void *self, va_list * app)
{
tsip_header_Service_Route_t *Service_Route = self;
if(Service_Route)
{
Service_Route->value = tsk_strdup(va_arg(*app, const char *));
TSIP_HEADER(Service_Route)->type = tsip_htype_Service_Route;
TSIP_HEADER(Service_Route)->tostring = tsip_header_Service_Route_tostring;
}
else
{
TSK_DEBUG_ERROR("Failed to create new Service_Route header.");
}
return self;
}
/**@ingroup tsip_header_Service_Route_group
*/
static void* tsip_header_Service_Route_destroy(void *self)
{
tsip_header_Service_Route_t *Service_Route = self;
if(Service_Route)
{
TSK_FREE(Service_Route->value);
TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Service_Route));
}
else TSK_DEBUG_ERROR("Null Service_Route header.");
return self;
}
static const tsk_object_def_t tsip_header_Service_Route_def_s =
{
sizeof(tsip_header_Service_Route_t),
tsip_header_Service_Route_create,
tsip_header_Service_Route_destroy,
0
};
const void *tsip_header_Service_Route_def_t = &tsip_header_Service_Route_def_s;

View File

@ -38,6 +38,7 @@
#include "tsk_debug.h" #include "tsk_debug.h"
#include "tsk_memory.h" #include "tsk_memory.h"
#include "tsk_base64.h" #include "tsk_base64.h"
#include "tsk_hmac.h"
#include <string.h> #include <string.h>
@ -181,13 +182,27 @@ int tsip_challenge_get_akares(const tsip_challenge_t *self, char const *password
*/ */
if(TSIP_CHALLENGE_IS_AKAv2(self)) if(TSIP_CHALLENGE_IS_AKAv2(self))
{ {
uint8_t res_ik_ck[AKA_RES_SIZE + AKA_IK_SIZE + AKA_CK_SIZE + 26]; uint8_t res_ik_ck[AKA_RES_SIZE + AKA_IK_SIZE + AKA_CK_SIZE];
tsk_md5digest_t md5_digest;
memcpy(res_ik_ck, akares, AKA_RES_SIZE); memcpy(res_ik_ck, akares, AKA_RES_SIZE);
memcpy((res_ik_ck + AKA_RES_SIZE), IK, AKA_IK_SIZE); memcpy((res_ik_ck + AKA_RES_SIZE), IK, AKA_IK_SIZE);
memcpy((res_ik_ck + AKA_RES_SIZE + AKA_IK_SIZE), CK, AKA_CK_SIZE); memcpy((res_ik_ck + AKA_RES_SIZE + AKA_IK_SIZE), CK, AKA_CK_SIZE);
memcpy((res_ik_ck + AKA_RES_SIZE + AKA_IK_SIZE + AKA_CK_SIZE), "http-digest-akav2-password", 26);
if((ret = hmac_md5digest_compute("http-digest-akav2-password", 26, res_ik_ck, sizeof(res_ik_ck), md5_digest))){/* PRF(RES||IK||CK, ...) */
ret = ((tsk_base64_encode(res_ik_ck, sizeof(res_ik_ck), result)>0) ? 0 : -2); TSK_DEBUG_ERROR("HMAC_MD5DIGEST_COMPUTE failed. AKAv2 response will be invalid.");
ret = -3;
goto bail;
}
else{/* b64(PRF(...)) */
if(!tsk_base64_encode(md5_digest, sizeof(md5_digest), result)){
TSK_DEBUG_ERROR("TSK_BASE64_ENCODE failed. AKAv2 response will be invalid.");
ret = -4;
goto bail;
}
}
} }
else else
{ {

View File

@ -41,7 +41,7 @@
#include "tsk_debug.h" #include "tsk_debug.h"
int tsip_dialog_update_challenges(tsip_dialog_t *self, const tsip_response_t* response); int tsip_dialog_update_challenges(tsip_dialog_t *self, const tsip_response_t* response, int acceptNewVector);
tsip_request_t *tsip_dialog_request_new(const tsip_dialog_t *self, const char* method) tsip_request_t *tsip_dialog_request_new(const tsip_dialog_t *self, const char* method)
{ {
@ -413,7 +413,13 @@ int tsip_dialog_update(tsip_dialog_t *self, const tsip_response_t* response)
*/ */
if(code == 401 || code == 407 || code == 421 || code == 494) if(code == 401 || code == 407 || code == 421 || code == 494)
{ {
return tsip_dialog_update_challenges(self, response); int acceptNewVector;
/* 3GPP IMS - Each authentication vector is used only once.
* ==> Re-registration/De-registration ==> Allow 401/407 challenge.
*/
acceptNewVector = (isRegister && self->state == tsip_established);
return tsip_dialog_update_challenges(self, response, acceptNewVector);
} }
else if(100 <= code || code >= 300) else if(100 <= code || code >= 300)
{ {
@ -464,7 +470,7 @@ int tsip_dialog_update(tsip_dialog_t *self, const tsip_response_t* response)
return -1; return -1;
} }
int tsip_dialog_update_challenges(tsip_dialog_t *self, const tsip_response_t* response) int tsip_dialog_update_challenges(tsip_dialog_t *self, const tsip_response_t* response, int acceptNewVector)
{ {
int ret = -1; int ret = -1;
size_t i; size_t i;
@ -501,7 +507,7 @@ int tsip_dialog_update_challenges(tsip_dialog_t *self, const tsip_response_t* re
challenge = item->data; challenge = item->data;
if(challenge->isproxy) continue; if(challenge->isproxy) continue;
if(tsk_strequals(challenge->realm, WWW_Authenticate->realm) && WWW_Authenticate->stale) if(tsk_strequals(challenge->realm, WWW_Authenticate->realm) && (WWW_Authenticate->stale || acceptNewVector))
{ {
/*== (B) ==*/ /*== (B) ==*/
if((ret = tsip_challenge_update(challenge, if((ret = tsip_challenge_update(challenge,
@ -549,7 +555,7 @@ int tsip_dialog_update_challenges(tsip_dialog_t *self, const tsip_response_t* re
challenge = item->data; challenge = item->data;
if(!challenge->isproxy) continue; if(!challenge->isproxy) continue;
if(tsk_strequals(challenge->realm, Proxy_Authenticate->realm) && Proxy_Authenticate->stale) if(tsk_strequals(challenge->realm, Proxy_Authenticate->realm) && (Proxy_Authenticate->stale || acceptNewVector))
{ {
/*== (B) ==*/ /*== (B) ==*/
if((ret = tsip_challenge_update(challenge, if((ret = tsip_challenge_update(challenge,

View File

@ -151,6 +151,7 @@ size_t tsip_transport_send(const tsip_transport_t* self, const char *branch, tsi
if(buffer) if(buffer)
{ {
tsip_message_tostring(msg, buffer); tsip_message_tostring(msg, buffer);
printf(buffer->data);
if(buffer->size >1300) if(buffer->size >1300)
{ {

View File

@ -315,6 +315,8 @@ tsip_stack_handle_t* tsip_stack_create(tsip_stack_callback callback, ...)
stack->proxy_cscf_port = 5060; stack->proxy_cscf_port = 5060;
stack->proxy_cscf_type = tnet_socket_type_udp_ipv4; stack->proxy_cscf_type = tnet_socket_type_udp_ipv4;
stack->enable_earlyIMS = 1;
va_start(params, callback); va_start(params, callback);
if(__tsip_stack_set(stack, params)) if(__tsip_stack_set(stack, params))
{ {

View File

@ -79,8 +79,8 @@ void test_stack()
TSIP_STACK_SET_DISPLAY_NAME("2233392625"), TSIP_STACK_SET_DISPLAY_NAME("2233392625"),
TSIP_STACK_SET_PUBLIC_IDENTITY("sip:2233392625@sip2sip.info"), TSIP_STACK_SET_PUBLIC_IDENTITY("sip:2233392625@sip2sip.info"),
TSIP_STACK_SET_PRIVATE_IDENTITY("2233392625"), TSIP_STACK_SET_PRIVATE_IDENTITY("2233392625"),
TSIP_STACK_SET_PASSWORD("d3sb7j4fb80"), TSIP_STACK_SET_PASSWORD("d3sb7j4fb8"),
TSIP_STACK_SET_REALM("sip:sip2sip.info"), TSIP_STACK_SET_REALM("sip:sip2sip.info"), // FIXME: without sip:
TSIP_STACK_SET_LOCAL_IP(LOCAL_IP), TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
TSIP_STACK_SET_DISCOVERY_NAPTR(1), TSIP_STACK_SET_DISCOVERY_NAPTR(1),
//TSIP_STACK_SET_PROXY_CSCF("proxy.sipthor.net", "udp", 0), //TSIP_STACK_SET_PROXY_CSCF("proxy.sipthor.net", "udp", 0),

View File

@ -173,22 +173,22 @@
Name="source" Name="source"
> >
<File <File
RelativePath="..\..\tinyHTTP\source\thttp.c" RelativePath="..\..\tinyHTTP\src\thttp.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinyHTTP\source\thttp_message.c" RelativePath="..\..\tinyHTTP\src\thttp_message.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinyHTTP\source\thttp_utl.c" RelativePath="..\..\tinyHTTP\src\thttp_utl.c"
> >
</File> </File>
<Filter <Filter
Name="auth" Name="auth"
> >
<File <File
RelativePath="..\..\tinyHTTP\source\auth\thttp_auth.c" RelativePath="..\..\tinyHTTP\src\auth\thttp_auth.c"
> >
</File> </File>
</Filter> </Filter>

View File

@ -6,7 +6,6 @@
ProjectGUID="{4CE20732-9978-4A88-B586-CFEFCB63E82D}" ProjectGUID="{4CE20732-9978-4A88-B586-CFEFCB63E82D}"
RootNamespace="tinySIP" RootNamespace="tinySIP"
Keyword="Win32Proj" Keyword="Win32Proj"
TargetFrameworkVersion="196613"
> >
<Platforms> <Platforms>
<Platform <Platform
@ -90,6 +89,9 @@
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
/> />
<Tool
Name="VCWebDeploymentTool"
/>
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
@ -157,9 +159,6 @@
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool
Name="VCFxCopTool"
/>
<Tool <Tool
Name="VCCodeSignTool" Name="VCCodeSignTool"
/> />
@ -247,6 +246,9 @@
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
/> />
<Tool
Name="VCWebDeploymentTool"
/>
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
@ -316,9 +318,6 @@
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool
Name="VCFxCopTool"
/>
<Tool <Tool
Name="VCCodeSignTool" Name="VCCodeSignTool"
/> />
@ -348,398 +347,402 @@
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\tsip.c" RelativePath="..\..\tinySIP\src\tsip.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\tsip_message.c" RelativePath="..\..\tinySIP\src\tsip_event.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\tsip_operation.c" RelativePath="..\..\tinySIP\src\tsip_message.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\tsip_timers.c" RelativePath="..\..\tinySIP\src\tsip_operation.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\tsip_uri.c" RelativePath="..\..\tinySIP\src\tsip_timers.c"
>
</File>
<File
RelativePath="..\..\tinySIP\src\tsip_uri.c"
> >
</File> </File>
<Filter <Filter
Name="headers" Name="headers"
> >
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header.c" RelativePath="..\..\tinySIP\src\headers\tsip_header.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_accept.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_accept.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Accept_Contact.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Accept_Contact.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Accept_Encoding.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Accept_Encoding.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Accept_Language.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Accept_Language.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Accept_Resource_Priority.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Accept_Resource_Priority.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Alert_Info.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Alert_Info.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Allow.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Allow.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Allow_Events.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Allow_Events.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Authentication_Info.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Authentication_Info.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Authorization.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Authorization.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Call_ID.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Call_ID.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Call_Info.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Call_Info.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Contact.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Contact.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Content_Disposition.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Content_Disposition.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Content_Encoding.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Content_Encoding.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Content_Language.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Content_Language.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Content_Length.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Content_Length.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Content_Type.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Content_Type.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_CSeq.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_CSeq.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Date.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Date.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Error_Info.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Error_Info.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Event.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Event.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Expires.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Expires.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_From.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_From.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_History_Info.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_History_Info.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Identity.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Identity.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Identity_Info.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Identity_Info.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_In_Reply_To.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_In_Reply_To.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Join.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Join.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Max_Forwards.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Max_Forwards.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_MIME_Version.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_MIME_Version.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Min_Expires.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Min_Expires.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Min_SE.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Min_SE.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Organization.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Organization.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Access_Network_Info.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Access_Network_Info.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Answer_State.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Answer_State.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Asserted_Identity.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Asserted_Identity.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Associated_URI.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Associated_URI.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Called_Party_ID.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Called_Party_ID.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Charging_Function_Addresses.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Charging_Function_Addresses.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Charging_Vector.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Charging_Vector.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_DCS_Billing_Info.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_DCS_Billing_Info.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_DCS_LAES.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_DCS_LAES.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_DCS_OSPS.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_DCS_OSPS.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_DCS_Redirect.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_DCS_Redirect.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_DCS_Trace_Party_ID.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_DCS_Trace_Party_ID.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Early_Media.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Early_Media.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Media_Authorization.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Media_Authorization.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Preferred_Identity.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Preferred_Identity.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Profile_Key.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Profile_Key.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_User_Database.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_User_Database.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_P_Visited_Network_ID.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_P_Visited_Network_ID.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Path.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Path.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Priority.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Priority.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Privacy.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Privacy.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Proxy_Authenticate.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Proxy_Authenticate.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Proxy_Authorization.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Proxy_Authorization.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Proxy_Require.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Proxy_Require.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_RAck.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_RAck.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Reason.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Reason.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Record_Route.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Record_Route.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Refer_Sub.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Refer_Sub.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Refer_To.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Refer_To.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Referred_By.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Referred_By.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Reject_Contact.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Reject_Contact.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Replaces.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Replaces.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Reply_To.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Reply_To.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Request_Disposition.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Request_Disposition.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Require.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Require.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Resource_Priority.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Resource_Priority.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Retry_After.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Retry_After.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Route.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Route.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_RSeq.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_RSeq.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Security_Client.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Security_Client.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Security_Server.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Security_Server.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Security_Verify.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Security_Verify.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Server.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Server.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Service_Route.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Service_Route.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Session_Expires.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Session_Expires.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_SIP_ETag.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_SIP_ETag.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_SIP_If_Match.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_SIP_If_Match.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Subject.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Subject.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Subscription_State.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Subscription_State.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Supported.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Supported.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Target_Dialog.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Target_Dialog.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Timestamp.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Timestamp.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_To.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_To.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Unsupported.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Unsupported.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_User_Agent.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_User_Agent.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Via.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Via.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_Warning.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_Warning.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\headers\tsip_header_WWW_Authenticate.c" RelativePath="..\..\tinySIP\src\headers\tsip_header_WWW_Authenticate.c"
> >
</File> </File>
</Filter> </Filter>
@ -747,19 +750,19 @@
Name="parsers" Name="parsers"
> >
<File <File
RelativePath="..\..\tinySIP\source\parsers\tsip_parser_header.c" RelativePath="..\..\tinySIP\src\parsers\tsip_parser_header.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\parsers\tsip_parser_message.c" RelativePath="..\..\tinySIP\src\parsers\tsip_parser_message.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\parsers\tsip_parser_uri.c" RelativePath="..\..\tinySIP\src\parsers\tsip_parser_uri.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\parsers\tsip_ragel_state.c" RelativePath="..\..\tinySIP\src\parsers\tsip_ragel_state.c"
> >
</File> </File>
</Filter> </Filter>
@ -767,27 +770,27 @@
Name="transactions" Name="transactions"
> >
<File <File
RelativePath="..\..\tinySIP\source\transactions\tsip_transac.c" RelativePath="..\..\tinySIP\src\transactions\tsip_transac.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\transactions\tsip_transac_ict.c" RelativePath="..\..\tinySIP\src\transactions\tsip_transac_ict.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\transactions\tsip_transac_ist.c" RelativePath="..\..\tinySIP\src\transactions\tsip_transac_ist.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\transactions\tsip_transac_layer.c" RelativePath="..\..\tinySIP\src\transactions\tsip_transac_layer.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\transactions\tsip_transac_nict.c" RelativePath="..\..\tinySIP\src\transactions\tsip_transac_nict.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\transactions\tsip_transac_nist.c" RelativePath="..\..\tinySIP\src\transactions\tsip_transac_nist.c"
> >
</File> </File>
</Filter> </Filter>
@ -795,27 +798,27 @@
Name="smc" Name="smc"
> >
<File <File
RelativePath="..\..\tinySIP\source\smc\tsip_dialog_message_sm.c" RelativePath="..\..\tinySIP\src\smc\tsip_dialog_message_sm.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\smc\tsip_dialog_register_sm.c" RelativePath="..\..\tinySIP\src\smc\tsip_dialog_register_sm.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\smc\tsip_transac_ict_sm.c" RelativePath="..\..\tinySIP\src\smc\tsip_transac_ict_sm.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\smc\tsip_transac_ist_sm.c" RelativePath="..\..\tinySIP\src\smc\tsip_transac_ist_sm.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\smc\tsip_transac_nict_sm.c" RelativePath="..\..\tinySIP\src\smc\tsip_transac_nict_sm.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\smc\tsip_transac_nist_sm.c" RelativePath="..\..\tinySIP\src\smc\tsip_transac_nist_sm.c"
> >
</File> </File>
</Filter> </Filter>
@ -823,11 +826,11 @@
Name="transports" Name="transports"
> >
<File <File
RelativePath="..\..\tinySIP\source\transports\tsip_transport.c" RelativePath="..\..\tinySIP\src\transports\tsip_transport.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\transports\tsip_transport_layer.c" RelativePath="..\..\tinySIP\src\transports\tsip_transport_layer.c"
> >
</File> </File>
</Filter> </Filter>
@ -835,39 +838,39 @@
Name="dialogs" Name="dialogs"
> >
<File <File
RelativePath="..\..\tinySIP\source\dialogs\tsip_dialog.c" RelativePath="..\..\tinySIP\src\dialogs\tsip_dialog.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\dialogs\tsip_dialog_invite.client.c" RelativePath="..\..\tinySIP\src\dialogs\tsip_dialog_invite.client.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\dialogs\tsip_dialog_invite.server.c" RelativePath="..\..\tinySIP\src\dialogs\tsip_dialog_invite.server.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\dialogs\tsip_dialog_layer.c" RelativePath="..\..\tinySIP\src\dialogs\tsip_dialog_layer.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\dialogs\tsip_dialog_message.c" RelativePath="..\..\tinySIP\src\dialogs\tsip_dialog_message.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\dialogs\tsip_dialog_register.client.c" RelativePath="..\..\tinySIP\src\dialogs\tsip_dialog_register.client.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\dialogs\tsip_dialog_register.server.c" RelativePath="..\..\tinySIP\src\dialogs\tsip_dialog_register.server.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\dialogs\tsip_dialog_subscribe.client.c" RelativePath="..\..\tinySIP\src\dialogs\tsip_dialog_subscribe.client.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\dialogs\tsip_dialog_subscribe.server.c" RelativePath="..\..\tinySIP\src\dialogs\tsip_dialog_subscribe.server.c"
> >
</File> </File>
</Filter> </Filter>
@ -875,15 +878,73 @@
Name="authentication" Name="authentication"
> >
<File <File
RelativePath="..\..\tinySIP\source\authentication\tsip_challenge.c" RelativePath="..\..\tinySIP\src\authentication\tsip_challenge.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\authentication\tsip_milenage.c" RelativePath="..\..\tinySIP\src\authentication\tsip_milenage.c"
> >
</File> </File>
<File <File
RelativePath="..\..\tinySIP\source\authentication\tsip_rijndael.c" RelativePath="..\..\tinySIP\src\authentication\tsip_rijndael.c"
>
</File>
</Filter>
<Filter
Name="api"
>
<File
RelativePath="..\..\tinySIP\src\api\tsip_invite.c"
>
</File>
<File
RelativePath="..\..\tinySIP\src\api\tsip_message.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)/$(InputName)1.obj"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)/$(InputName)1.obj"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\tinySIP\src\api\tsip_publish.c"
>
</File>
<File
RelativePath="..\..\tinySIP\src\api\tsip_register.c"
>
</File>
<File
RelativePath="..\..\tinySIP\src\api\tsip_subscribe.c"
> >
</File> </File>
</Filter> </Filter>
@ -901,6 +962,10 @@
RelativePath="..\..\tinySIP\include\tsip.h" RelativePath="..\..\tinySIP\include\tsip.h"
> >
</File> </File>
<File
RelativePath="..\..\tinySIP\include\tinysip\tsip_event.h"
>
</File>
<File <File
RelativePath="..\..\tinySIP\include\tinysip\tsip_message.h" RelativePath="..\..\tinySIP\include\tinysip\tsip_message.h"
> >
@ -1429,6 +1494,30 @@
> >
</File> </File>
</Filter> </Filter>
<Filter
Name="api"
>
<File
RelativePath="..\..\tinySIP\include\tinysip\api\tsip_invite.h"
>
</File>
<File
RelativePath="..\..\tinySIP\include\tinysip\api\tsip_message.h"
>
</File>
<File
RelativePath="..\..\tinySIP\include\tinysip\api\tsip_publish.h"
>
</File>
<File
RelativePath="..\..\tinySIP\include\tinysip\api\tsip_register.h"
>
</File>
<File
RelativePath="..\..\tinySIP\include\tinysip\api\tsip_subscribe.h"
>
</File>
</Filter>
</Filter> </Filter>
<Filter <Filter
Name="ragel" Name="ragel"