Update MAC OSX support.

This commit is contained in:
bossiel 2010-02-12 00:16:23 +00:00
parent 4fbc0d545c
commit 7b2d6e3a81
19 changed files with 4104 additions and 2060 deletions

View File

@ -1,329 +1,329 @@
/* /*
* Copyright (C) 2009 Mamadou Diop. * Copyright (C) 2009 Mamadou Diop.
* *
* Contact: Mamadou Diop <diopmamadou@yahoo.fr> * Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* *
* This file is part of Open Source Doubango Framework. * This file is part of Open Source Doubango Framework.
* *
* DOUBANGO is free software: you can redistribute it and/or modify * DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* DOUBANGO is distributed in the hope that it will be useful, * DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with DOUBANGO. * along with DOUBANGO.
* *
*/ */
/**@file tnet_dhcp.c /**@file tnet_dhcp.c
* @brief DHCP/BOOTP (RFC 2131 - Dynamic Host Configuration Protocol) utilities function for P-CSCF discovery(RFC 3319 and 3361). * @brief DHCP/BOOTP (RFC 2131 - Dynamic Host Configuration Protocol) utilities function for P-CSCF discovery(RFC 3319 and 3361).
* Also implement: RFC 3315, 3118, 3319, 3825 (Geoconf), 4676 (Civic Addresses Configuration Information) ... * Also implement: RFC 3315, 3118, 3319, 3825 (Geoconf), 4676 (Civic Addresses Configuration Information) ...
* *
* @author Mamadou Diop <diopmamadou(at)yahoo.fr> * @author Mamadou Diop <diopmamadou(at)yahoo.fr>
* *
* @date Created: Sat Nov 8 16:54:58 2009 mdiop * @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/ */
#include "tnet_dhcp.h" #include "tnet_dhcp.h"
#include "tsk_string.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> #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/
// Another one: http://www.slideshare.net/raini/DHCP-Presentation-v102 // Another one: http://www.slideshare.net/raini/DHCP-Presentation-v102
// RFC 3319 Dynamic Host Configuration Protocol (DHCPv6) Options for Session Initiation Protocol (SIP) Servers // RFC 3319 Dynamic Host Configuration Protocol (DHCPv6) Options for Session Initiation Protocol (SIP) Servers
// RFC 3361 Dynamic Host Configuration Protocol (DHCP-for-IPv4) Option for Session Initiation Protocol (SIP) Servers // RFC 3361 Dynamic Host Configuration Protocol (DHCP-for-IPv4) Option for Session Initiation Protocol (SIP) Servers
/* FIXME: USE retransmission mech (*2*2...) /* FIXME: USE retransmission mech (*2*2...)
*/ */
tnet_dhcp_reply_t* tnet_dhcp_send_request(tnet_dhcp_ctx_t* ctx, tnet_dhcp_request_t* request) tnet_dhcp_reply_t* tnet_dhcp_send_request(tnet_dhcp_ctx_t* ctx, tnet_dhcp_request_t* request)
{ {
tsk_buffer_t *output; tsk_buffer_t *output;
tnet_dhcp_reply_t* reply = 0; tnet_dhcp_reply_t* reply = 0;
int ret; int ret;
struct timeval tv; struct timeval tv;
fd_set set; fd_set set;
uint64_t timeout = 0; uint64_t timeout = 0;
tsk_list_item_t *item; tsk_list_item_t *item;
const tnet_interface_t *iface; const tnet_interface_t *iface;
tnet_socket_t *localsocket4 = 0; tnet_socket_t *localsocket4 = 0;
struct sockaddr_storage server; struct sockaddr_storage server;
if(!ctx || !request) if(!ctx || !request)
{ {
goto bail; goto bail;
} }
localsocket4 = TNET_SOCKET_CREATE(TNET_SOCKET_HOST_ANY, ctx->port_client, tnet_socket_type_udp_ipv4); localsocket4 = TNET_SOCKET_CREATE(TNET_SOCKET_HOST_ANY, ctx->port_client, tnet_socket_type_udp_ipv4);
if(!TNET_SOCKET_IS_VALID(localsocket4)) if(!TNET_SOCKET_IS_VALID(localsocket4))
{ {
TSK_DEBUG_ERROR("Failed to create/bind DHCP client socket."); TSK_DEBUG_ERROR("Failed to create/bind DHCP client socket.");
goto bail; goto bail;
} }
/* Always wait for 200ms before retransmission */ /* Always wait for 200ms before retransmission */
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = (200 * 1000); tv.tv_usec = (200 * 1000);
if(tnet_sockaddr_init("255.255.255.255", ctx->server_port, tnet_socket_type_udp_ipv4, &server)) if(tnet_sockaddr_init("255.255.255.255", ctx->server_port, tnet_socket_type_udp_ipv4, &server))
{ {
TNET_PRINT_LAST_ERROR("Failed to initialize the DHCP server address."); TNET_PRINT_LAST_ERROR("Failed to initialize the DHCP server address.");
goto bail; goto bail;
} }
/* ENABLE BROADCASTING */ /* ENABLE BROADCASTING */
{ {
#if defined(SOLARIS) #if defined(SOLARIS)
char yes = '1'; char yes = '1';
#else #else
int yes = 1; int yes = 1;
#endif #endif
if(setsockopt(localsocket4->fd, SOL_SOCKET, SO_BROADCAST, (char*)&yes, sizeof(int))) if(setsockopt(localsocket4->fd, SOL_SOCKET, SO_BROADCAST, (char*)&yes, sizeof(int)))
{ {
TSK_DEBUG_ERROR("Failed to enable broadcast option [errno=%d].", tnet_geterrno()); TSK_DEBUG_ERROR("Failed to enable broadcast option [errno=%d].", tnet_geterrno());
goto bail; goto bail;
} }
} }
/* Set timeout */ /* Set timeout */
timeout = tsk_time_epoch() + ctx->timeout; timeout = tsk_time_epoch() + ctx->timeout;
do do
{ {
/* RFC 2131 - 3.6 Use of DHCP in clients with multiple interfaces /* RFC 2131 - 3.6 Use of DHCP in clients with multiple interfaces
A client with multiple network interfaces must use DHCP through each A client with multiple network interfaces must use DHCP through each
interface independently to obtain configuration information interface independently to obtain configuration information
parameters for those separate interfaces. parameters for those separate interfaces.
*/ */
tsk_list_foreach(item, ctx->interfaces) tsk_list_foreach(item, ctx->interfaces)
{ {
iface = item->data; iface = item->data;
/* Set FD */ /* Set FD */
FD_ZERO(&set); FD_ZERO(&set);
FD_SET(localsocket4->fd, &set); FD_SET(localsocket4->fd, &set);
/* ciaddr */ /* ciaddr */
if(request->type == dhcp_type_inform){ if(request->type == dhcp_type_inform){
struct sockaddr_storage ss; struct sockaddr_storage ss;
if(!tnet_get_sockaddr(localsocket4->fd, &ss)){ if(!tnet_get_sockaddr(localsocket4->fd, &ss)){
uint32_t addr = htonl((*((uint32_t*)&((struct sockaddr_in*)&ss)->sin_addr))); uint32_t addr = htonl((*((uint32_t*)&((struct sockaddr_in*)&ss)->sin_addr)));
memcpy(&request->ciaddr, &addr, 4); 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(ctx, 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;
} }
/* Send the request to the DHCP server */ /* Send the request to the DHCP server */
if((ret =tnet_sockfd_sendto(localsocket4->fd, (const struct sockaddr*)&server, output->data, output->size))<0) if((ret =tnet_sockfd_sendto(localsocket4->fd, (const struct sockaddr*)&server, output->data, output->size))<0)
{ {
TNET_PRINT_LAST_ERROR("Failed to send DHCP request."); TNET_PRINT_LAST_ERROR("Failed to send DHCP request.");
tsk_thread_sleep(150); // wait 150ms before trying the next iface. tsk_thread_sleep(150); // wait 150ms before trying the next iface.
goto next_iface; goto next_iface;
} }
/* wait for response */ /* wait for response */
if((ret = select(localsocket4->fd+1, &set, NULL, NULL, &tv))<0) if((ret = select(localsocket4->fd+1, &set, NULL, NULL, &tv))<0)
{ /* Error */ { /* Error */
TNET_PRINT_LAST_ERROR("select have failed."); TNET_PRINT_LAST_ERROR("select have failed.");
tsk_thread_sleep(150); // wait 150ms before trying the next iface. tsk_thread_sleep(150); // wait 150ms before trying the next iface.
goto next_iface; goto next_iface;
} }
else if(ret == 0) else if(ret == 0)
{ /* timeout ==> do nothing */ { /* timeout ==> do nothing */
} }
else else
{ /* there is data to read */ { /* there is data to read */
size_t len = 0; size_t len = 0;
void* data = 0; void* data = 0;
/* Check how how many bytes are pending */ /* Check how how many bytes are pending */
if((ret = tnet_ioctlt(localsocket4->fd, FIONREAD, &len))<0) if((ret = tnet_ioctlt(localsocket4->fd, FIONREAD, &len))<0)
{ {
goto next_iface; goto next_iface;
} }
/* Receive pending data */ /* Receive pending data */
data = tsk_calloc(len, sizeof(uint8_t)); data = tsk_calloc(len, sizeof(uint8_t));
if((ret = tnet_sockfd_recv(localsocket4->fd, data, len, 0))<0) if((ret = tnet_sockfd_recv(localsocket4->fd, data, len, 0))<0)
{ {
TSK_FREE(data); TSK_FREE(data);
TNET_PRINT_LAST_ERROR("Failed to receive DHCP dgrams."); TNET_PRINT_LAST_ERROR("Failed to receive DHCP dgrams.");
goto next_iface; goto next_iface;
} }
/* Parse the incoming response. */ /* Parse the incoming response. */
reply = tnet_dhcp_message_deserialize(ctx, data, len); reply = tnet_dhcp_message_deserialize(ctx, data, len);
TSK_FREE(data); TSK_FREE(data);
if(reply) if(reply)
{ /* response successfuly parsed */ { /* response successfuly parsed */
if(request->xid != reply->xid) if(request->xid != reply->xid)
{ /* Not same transaction id ==> continue*/ { /* Not same transaction id ==> continue*/
TSK_OBJECT_SAFE_FREE(reply); TSK_OBJECT_SAFE_FREE(reply);
} }
} }
} }
next_iface: next_iface:
TSK_OBJECT_SAFE_FREE(output); TSK_OBJECT_SAFE_FREE(output);
if(reply){ if(reply){
goto bail; goto bail;
} }
} }
break;//FIXME break;//FIXME
} }
while(timeout > tsk_time_epoch()); while(timeout > tsk_time_epoch());
bail: bail:
TSK_OBJECT_SAFE_FREE(localsocket4); TSK_OBJECT_SAFE_FREE(localsocket4);
return reply; return reply;
} }
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* 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();
if(!ctx || !params || !request) if(!ctx || !params || !request)
{ {
goto bail; goto bail;
} }
request->type = type; request->type = type;
tnet_dhcp_message_add_codes(request, params->codes, params->codes_count); 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:
TSK_OBJECT_SAFE_FREE(request); TSK_OBJECT_SAFE_FREE(request);
return reply; return reply;
} }
int tnet_dhcp_params_add_code(tnet_dhcp_params_t* params, tnet_dhcp_option_code_t code) int tnet_dhcp_params_add_code(tnet_dhcp_params_t* params, tnet_dhcp_option_code_t code)
{ {
if(params){ if(params){
if(params->codes_count < TNET_DHCP_MAX_CODES){ if(params->codes_count < TNET_DHCP_MAX_CODES){
unsigned i; unsigned i;
for(i=0; i<params->codes_count; i++){ for(i=0; i<params->codes_count; i++){
if(params->codes[i] == code){ if(params->codes[i] == code){
return -3; return -3;
} }
} }
params->codes[params->codes_count++] = code; params->codes[params->codes_count++] = code;
} }
else return -2; else return -2;
} }
return -1; return -1;
} }
//================================================================================================= //=================================================================================================
// [[DHCP CONTEXT]] object definition // [[DHCP CONTEXT]] object definition
// //
static void* tnet_dhcp_ctx_create(void * self, va_list * app) 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; tnet_host_t host;
ctx->vendor_id = tsk_strdup(TNET_DHCP_VENDOR_ID_DEFAULT); ctx->vendor_id = tsk_strdup(TNET_DHCP_VENDOR_ID_DEFAULT);
if(!tnet_gethostname(&host)){ if(!tnet_gethostname(&host)){
ctx->hostname = tsk_strndup(host, strlen(host)); ctx->hostname = tsk_strndup(host, strlen(host));
} }
ctx->timeout = TNET_DHCP_TIMEOUT_DEFAULT; ctx->timeout = TNET_DHCP_TIMEOUT_DEFAULT;
ctx->max_msg_size = TNET_DHCP_MAX_MSG_SIZE; ctx->max_msg_size = TNET_DHCP_MAX_MSG_SIZE;
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;
ctx->interfaces = tnet_get_interfaces(); ctx->interfaces = tnet_get_interfaces();
if(!ctx->interfaces || TSK_LIST_IS_EMPTY(ctx->interfaces)) if(!ctx->interfaces || TSK_LIST_IS_EMPTY(ctx->interfaces))
{ {
TSK_DEBUG_ERROR("Failed to retrieve network interfaces."); TSK_DEBUG_ERROR("Failed to retrieve network interfaces.");
} }
tsk_safeobj_init(ctx); tsk_safeobj_init(ctx);
} }
return self; return self;
} }
static void* tnet_dhcp_ctx_destroy(void * self) static void* tnet_dhcp_ctx_destroy(void * self)
{ {
tnet_dhcp_ctx_t *ctx = self; tnet_dhcp_ctx_t *ctx = self;
if(ctx) if(ctx)
{ {
tsk_safeobj_deinit(ctx); tsk_safeobj_deinit(ctx);
TSK_FREE(ctx->vendor_id); TSK_FREE(ctx->vendor_id);
TSK_FREE(ctx->hostname); TSK_FREE(ctx->hostname);
TSK_OBJECT_SAFE_FREE(ctx->interfaces); TSK_OBJECT_SAFE_FREE(ctx->interfaces);
} }
return self; return self;
} }
static const tsk_object_def_t tnet_dhcp_ctx_def_s = static const tsk_object_def_t tnet_dhcp_ctx_def_s =
{ {
sizeof(tnet_dhcp_ctx_t), sizeof(tnet_dhcp_ctx_t),
tnet_dhcp_ctx_create, tnet_dhcp_ctx_create,
tnet_dhcp_ctx_destroy, tnet_dhcp_ctx_destroy,
0, 0,
}; };
const void *tnet_dhcp_ctx_def_t = &tnet_dhcp_ctx_def_s; const void *tnet_dhcp_ctx_def_t = &tnet_dhcp_ctx_def_s;
//================================================================================================= //=================================================================================================
// [[DHCP PARAMS]] object definition // [[DHCP PARAMS]] object definition
// //
static void* tnet_dhcp_params_create(void * self, va_list * app) 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)
{ {
} }
return self; return self;
} }
static void* tnet_dhcp_params_destroy(void * self) static void* tnet_dhcp_params_destroy(void * self)
{ {
tnet_dhcp_params_t *params = self; tnet_dhcp_params_t *params = self;
if(params) if(params)
{ {
} }
return self; return self;
} }
static const tsk_object_def_t tnet_dhcp_params_def_s = static const tsk_object_def_t tnet_dhcp_params_def_s =
{ {
sizeof(tnet_dhcp_params_t), sizeof(tnet_dhcp_params_t),
tnet_dhcp_params_create, tnet_dhcp_params_create,
tnet_dhcp_params_destroy, tnet_dhcp_params_destroy,
0, 0,
}; };
const void *tnet_dhcp_params_def_t = &tnet_dhcp_params_def_s; const void *tnet_dhcp_params_def_t = &tnet_dhcp_params_def_s;

View File

@ -1,105 +1,105 @@
/* /*
* Copyright (C) 2009 Mamadou Diop. * Copyright (C) 2009 Mamadou Diop.
* *
* Contact: Mamadou Diop <diopmamadou@yahoo.fr> * Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* *
* This file is part of Open Source Doubango Framework. * This file is part of Open Source Doubango Framework.
* *
* DOUBANGO is free software: you can redistribute it and/or modify * DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* DOUBANGO is distributed in the hope that it will be useful, * DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with DOUBANGO. * along with DOUBANGO.
* *
*/ */
/**@file tnet_dhcp.h /**@file tnet_dhcp.h
* @brief DHCP (RFC 2131 - Dynamic Host Configuration Protocol) utilities function for P-CSCF discovery(RFC 3319 and 3361) * @brief DHCP (RFC 2131 - Dynamic Host Configuration Protocol) utilities function for P-CSCF discovery(RFC 3319 and 3361)
* Also implement: RFC 3315, 3118, 3319, 3825 (Geoconf), 4676 (Civic Addresses Configuration Information)... * Also implement: RFC 3315, 3118, 3319, 3825 (Geoconf), 4676 (Civic Addresses Configuration Information)...
* *
* @author Mamadou Diop <diopmamadou(at)yahoo.fr> * @author Mamadou Diop <diopmamadou(at)yahoo.fr>
* *
* @date Created: Sat Nov 8 16:54:58 2009 mdiop * @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/ */
#ifndef TNET_DHCP_H #ifndef TNET_DHCP_H
#define TNET_DHCP_H #define TNET_DHCP_H
#include "tinyNET_config.h" #include "tinyNET_config.h"
#include "tnet_dhcp_message.h" #include "tnet_dhcp_message.h"
#include "tnet_utils.h" #include "tnet_utils.h"
#include "tsk_object.h" #include "tsk_object.h"
#include "tsk_safeobj.h" #include "tsk_safeobj.h"
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() tsk_object_new(tnet_dhcp_params_def_t) #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.
*/ */
#define TNET_DHCP_TIMEOUT_DEFAULT 2000 #define TNET_DHCP_TIMEOUT_DEFAULT 2000
/**< Local port(client) to bind to for incoming DHCP messages as per RFC 2131 subclause 4.1. */ /**< Local port(client) to bind to for incoming DHCP messages as per RFC 2131 subclause 4.1. */
#define TNET_DHCP_CLIENT_PORT 68 #define TNET_DHCP_CLIENT_PORT 68
/**< 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 "doubango/v0.0.0" #define TNET_DHCP_VENDOR_ID_DEFAULT "doubango/v0.0.0"
#define TNET_DHCP_MAX_CODES 20 #define TNET_DHCP_MAX_CODES 20
#define TNET_DHCP_MAX_MSG_SIZE 1500 #define TNET_DHCP_MAX_MSG_SIZE 1500
/** Parameter Request List (55) /** 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_code_t codes[TNET_DHCP_MAX_CODES]; tnet_dhcp_option_code_t codes[TNET_DHCP_MAX_CODES];
unsigned codes_count; unsigned codes_count;
} }
tnet_dhcp_params_t; tnet_dhcp_params_t;
typedef struct tnet_dhcp_ctx_s typedef struct tnet_dhcp_ctx_s
{ {
TSK_DECLARE_OBJECT; TSK_DECLARE_OBJECT;
char* vendor_id; char* vendor_id;
char* hostname; char* hostname;
uint16_t max_msg_size; /**< Option code 57. */ uint16_t max_msg_size; /**< Option code 57. */
uint64_t timeout; uint64_t timeout;
tnet_port_t port_client; /**< Local port to bind to for incloming DHCP messages. Default: 68 */ tnet_port_t port_client; /**< Local port to bind to for incloming DHCP messages. Default: 68 */
tnet_port_t server_port; /**< Destination port for outgoing DHCP messages. Default: 64 */ tnet_port_t server_port; /**< Destination port for outgoing DHCP messages. Default: 64 */
tnet_interfaces_L_t *interfaces; tnet_interfaces_L_t *interfaces;
TSK_DECLARE_SAFEOBJ; TSK_DECLARE_SAFEOBJ;
} }
tnet_dhcp_ctx_t; tnet_dhcp_ctx_t;
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); 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_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_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_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_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) #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_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;
TNET_END_DECLS TNET_END_DECLS
#endif /* TNET_DHCP_H */ #endif /* TNET_DHCP_H */

View File

@ -1,303 +1,305 @@
/* /*
* Copyright (C) 2009 Mamadou Diop. * Copyright (C) 2009 Mamadou Diop.
* *
* Contact: Mamadou Diop <diopmamadou@yahoo.fr> * Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* *
* This file is part of Open Source Doubango Framework. * This file is part of Open Source Doubango Framework.
* *
* DOUBANGO is free software: you can redistribute it and/or modify * DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* DOUBANGO is distributed in the hope that it will be useful, * DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with DOUBANGO. * along with DOUBANGO.
* *
*/ */
/**@file tnet_dhcp_message.c /**@file tnet_dhcp_message.c
* @brief DHCP Message as per RFC 2131 subclause 2. * @brief DHCP Message as per RFC 2131 subclause 2.
* *
* @author Mamadou Diop <diopmamadou(at)yahoo.fr> * @author Mamadou Diop <diopmamadou(at)yahoo.fr>
* *
* @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_dhcp.h"
#include "../tnet_utils.h" #include "../tnet_utils.h"
#include "tsk_time.h" #include "tsk_time.h"
#include "tsk_memory.h" #include "tsk_memory.h"
#include "tsk_string.h" #include "tsk_string.h"
#include "tsk_debug.h" #include "tsk_debug.h"
tsk_buffer_t* tnet_dhcp_message_serialize(const struct tnet_dhcp_ctx_s *ctx, const tnet_dhcp_message_t *message) #include <string.h>
{
tsk_buffer_t* output = 0; tsk_buffer_t* tnet_dhcp_message_serialize(const tnet_dhcp_ctx_t *ctx, const tnet_dhcp_message_t *message)
uint8_t _1byte; {
uint16_t _2bytes; tsk_buffer_t* output = 0;
uint32_t _4bytes; uint8_t _1byte;
uint16_t _2bytes;
/* Check message validity */ uint32_t _4bytes;
if(!message){
goto bail; /* Check message validity */
} if(!message){
goto bail;
output = TSK_BUFFER_CREATE_NULL(); }
/*== OP HTYPE HLEN HOPS */ output = TSK_BUFFER_CREATE_NULL();
_4bytes = (((uint32_t)(message->op)) << 24) |
(((uint32_t)(message->htype)) << 16) | /*== OP HTYPE HLEN HOPS */
(((uint16_t)(message->hlen)) << 8) | message->hops; _4bytes = (((uint32_t)(message->op)) << 24) |
_4bytes = ntohl(_4bytes); (((uint32_t)(message->htype)) << 16) |
tsk_buffer_append(output, &(_4bytes), 4); (((uint16_t)(message->hlen)) << 8) | message->hops;
_4bytes = ntohl(_4bytes);
/*== XID */ tsk_buffer_append(output, &(_4bytes), 4);
_4bytes = ntohl(message->xid);
tsk_buffer_append(output, &(_4bytes), 4); /*== XID */
/*== SECS */ _4bytes = ntohl(message->xid);
_2bytes = ntohs(message->secs); tsk_buffer_append(output, &(_4bytes), 4);
tsk_buffer_append(output, &(_2bytes), 2); /*== SECS */
/*== FLAGS */ _2bytes = ntohs(message->secs);
_2bytes = ntohs(message->flags); tsk_buffer_append(output, &(_2bytes), 2);
tsk_buffer_append(output, &(_2bytes), 2); /*== FLAGS */
/*== CIADDR */ _2bytes = ntohs(message->flags);
_4bytes = ntohl(message->ciaddr); tsk_buffer_append(output, &(_2bytes), 2);
tsk_buffer_append(output, &(_4bytes), 4); /*== CIADDR */
/*== YIADDR */ _4bytes = ntohl(message->ciaddr);
_4bytes = ntohl(message->yiaddr); tsk_buffer_append(output, &(_4bytes), 4);
tsk_buffer_append(output, &(_4bytes), 4); /*== YIADDR */
/*== SIADDR */ _4bytes = ntohl(message->yiaddr);
_4bytes = ntohl(message->siaddr); tsk_buffer_append(output, &(_4bytes), 4);
tsk_buffer_append(output, &(_4bytes), 4); /*== SIADDR */
/*== GIADDR */ _4bytes = ntohl(message->siaddr);
_4bytes = ntohl(message->giaddr); tsk_buffer_append(output, &(_4bytes), 4);
tsk_buffer_append(output, &(_4bytes), 4); /*== GIADDR */
/*== CHADDR */ _4bytes = ntohl(message->giaddr);
tsk_buffer_append(output, message->chaddr, sizeof(message->chaddr)); tsk_buffer_append(output, &(_4bytes), 4);
/*== sname (unused) */ /*== CHADDR */
tsk_buffer_append(output, message->sname, sizeof(message->sname)); tsk_buffer_append(output, message->chaddr, sizeof(message->chaddr));
/*== file (unused) */ /*== sname (unused) */
tsk_buffer_append(output, message->file, sizeof(message->file)); tsk_buffer_append(output, message->sname, sizeof(message->sname));
/*== Magic Cookie */ /*== file (unused) */
_4bytes = ntohl(TNET_DHCP_MAGIC_COOKIE); tsk_buffer_append(output, message->file, sizeof(message->file));
tsk_buffer_append(output, &(_4bytes), 4); /*== Magic Cookie */
_4bytes = ntohl(TNET_DHCP_MAGIC_COOKIE);
/*== Message Type (option 53) tsk_buffer_append(output, &(_4bytes), 4);
*/
tnet_dhcp_option_serializeex(dhcp_code_DHCP_Msg_Type, 1, &message->type, output); /*== Message Type (option 53)
*/
/*== Client Identifier (option 61) ==> RFC 2132 - 9.14. Client-identifier tnet_dhcp_option_serializeex(dhcp_code_DHCP_Msg_Type, 1, &message->type, output);
Code Len Type Client-Identifier
+-----+-----+-----+-----+-----+--- /*== Client Identifier (option 61) ==> RFC 2132 - 9.14. Client-identifier
| 61 | n | t1 | i1 | i2 | ... 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)*/{ if(message->hlen){
client_id[0] = message->htype; uint8_t client_id[17]; // 16 /*sizeof(chaddr)*/+ 1/*htype*/
memcpy(&client_id[1], message->chaddr, message->hlen); /*if(client_id)*/{
tnet_dhcp_option_serializeex(dhcp_code_Client_Id, (message->hlen+1), client_id, output); 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 }
+-----+-----+-----+-----+-----+-----+-----+-----+-- /*== Host name(10) ==> RFC 2132 - 3.14. Host Name Option
| 12 | n | h1 | h2 | h3 | h4 | h5 | h6 | ... 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); */
} if(TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->hostname){
/*== Vendor classId(60) ==> RFC 2132 - 9.13. Vendor class identifier tnet_dhcp_option_serializeex(dhcp_code_Hostname, strlen(ctx->hostname), ctx->hostname, output);
Code Len Vendor class Identifier }
+-----+-----+-----+-----+--- /*== Vendor classId(60) ==> RFC 2132 - 9.13. Vendor class identifier
| 60 | n | i1 | i2 | ... 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); */
} 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);
/*== RFC 2132 - 9.10. Maximum DHCP Message Size (57) }
Code Len Length
+-----+-----+-----+-----+ /*== RFC 2132 - 9.10. Maximum DHCP Message Size (57)
| 57 | 2 | l1 | l2 | Code Len Length
+-----+-----+-----+-----+ +-----+-----+-----+-----+
*/ | 57 | 2 | l1 | l2 |
if(TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->max_msg_size){ +-----+-----+-----+-----+
_2bytes = ntohs(ctx->max_msg_size); */
tnet_dhcp_option_serializeex(dhcp_code_DHCP_Max_Msg_Size, 2, &_2bytes, output); if(TNET_DHCP_MESSAGE_IS_REQUEST(message) && ctx->max_msg_size){
} _2bytes = ntohs(ctx->max_msg_size);
tnet_dhcp_option_serializeex(dhcp_code_DHCP_Max_Msg_Size, 2, &_2bytes, output);
/*== DHCP Options }
*/
{ /*== DHCP Options
tsk_list_item_t *item; */
tnet_dhcp_option_t* option; {
tsk_list_foreach(item, message->options) tsk_list_item_t *item;
{ tnet_dhcp_option_t* option;
option = (tnet_dhcp_option_t*)item->data; tsk_list_foreach(item, message->options)
if(tnet_dhcp_option_serialize(option, output)){ {
TSK_DEBUG_WARN("Failed to serialize DHCP OPTION (%u)", option->code); 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 }
The last option must always be the 'end' option.
*/ /* RFC 2131 - 4.1 Constructing and sending DHCP messages
_1byte = dhcp_code_End; The last option must always be the 'end' option.
tsk_buffer_append(output, &(_1byte), 1); */
_1byte = dhcp_code_End;
bail: tsk_buffer_append(output, &(_1byte), 1);
return output;
} bail:
return output;
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* tnet_dhcp_message_deserialize(const struct tnet_dhcp_ctx_s *ctx, const uint8_t *data, size_t size)
uint8_t *dataPtr, *dataEnd, *dataStart; {
tnet_dhcp_message_t *message = 0;
if(!data || !size) uint8_t *dataPtr, *dataEnd, *dataStart;
{
goto bail; if(!data || !size)
} {
goto bail;
if(size < TNET_DHCP_MESSAGE_MIN_SIZE){ }
TSK_DEBUG_ERROR("DHCP message too short.");
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; if(!(message = TNET_DHCP_REPLY_CREATE())){ /* If REQUEST OP will be overridedden */
} TSK_DEBUG_ERROR("Failed to create new DHCP message.");
goto bail;
dataPtr = (uint8_t*)data; }
dataStart = dataPtr;
dataEnd = (dataStart + size); dataPtr = (uint8_t*)data;
dataStart = dataPtr;
/*== op (1)*/ dataEnd = (dataStart + size);
message->op = *(dataPtr++);
/*== htype (1) */ /*== op (1)*/
message->htype = *(dataPtr++); message->op = *(dataPtr++);
/*== hlen (1) */ /*== htype (1) */
message->hlen = *(dataPtr++); message->htype = *(dataPtr++);
/*== htype (1) */ /*== hlen (1) */
message->hops = *(dataPtr++); message->hlen = *(dataPtr++);
/*== xid (4) */ /*== htype (1) */
message->xid= ntohl(*((uint32_t*)dataPtr)); message->hops = *(dataPtr++);
dataPtr += 4; /*== xid (4) */
/*== secs (2) */ message->xid= ntohl(*((uint32_t*)dataPtr));
message->secs = ntohs(*((uint16_t*)dataPtr)); dataPtr += 4;
dataPtr += 2; /*== secs (2) */
/*== flags (2) */ message->secs = ntohs(*((uint16_t*)dataPtr));
message->flags = ntohs(*((uint16_t*)dataPtr)); dataPtr += 2;
dataPtr += 2; /*== flags (2) */
/*== ciaddr (4) */ message->flags = ntohs(*((uint16_t*)dataPtr));
message->ciaddr= ntohl(*((uint32_t*)dataPtr)); dataPtr += 2;
dataPtr += 4; /*== ciaddr (4) */
/*== yiaddr (4) */ message->ciaddr= ntohl(*((uint32_t*)dataPtr));
message->yiaddr= ntohl(*((uint32_t*)dataPtr)); dataPtr += 4;
dataPtr += 4; /*== yiaddr (4) */
/*== siaddr (4) */ message->yiaddr= ntohl(*((uint32_t*)dataPtr));
message->siaddr= ntohl(*((uint32_t*)dataPtr)); dataPtr += 4;
dataPtr += 4; /*== siaddr (4) */
/*== giaddr (4) */ message->siaddr= ntohl(*((uint32_t*)dataPtr));
message->giaddr= ntohl(*((uint32_t*)dataPtr)); dataPtr += 4;
dataPtr += 4; /*== giaddr (4) */
/*== chaddr (16[max]) */ message->giaddr= ntohl(*((uint32_t*)dataPtr));
memcpy(message->chaddr, dataPtr, message->hlen>16 ? 16 : message->hlen); dataPtr += 4;
dataPtr += 16; /*== chaddr (16[max]) */
/*== sname (64) */ memcpy(message->chaddr, dataPtr, message->hlen>16 ? 16 : message->hlen);
memcpy(message->sname, dataPtr, 64); dataPtr += 16;
dataPtr += 64; /*== sname (64) */
/*== file (128) */ memcpy(message->sname, dataPtr, 64);
memcpy(message->file, dataPtr, 128); dataPtr += 64;
dataPtr += 128; /*== file (128) */
/*== Magic Cookie (4) */ memcpy(message->file, dataPtr, 128);
if(ntohl(*((uint32_t*)dataPtr)) != TNET_DHCP_MAGIC_COOKIE){ dataPtr += 128;
TSK_DEBUG_ERROR("Invalid DHCP magic cookie."); /*== Magic Cookie (4) */
// Do not exit ==> continue parsing. if(ntohl(*((uint32_t*)dataPtr)) != TNET_DHCP_MAGIC_COOKIE){
} TSK_DEBUG_ERROR("Invalid DHCP magic cookie.");
dataPtr += 4; // Do not exit ==> continue parsing.
}
/*== options (variable) */ dataPtr += 4;
while(dataPtr<dataEnd && *dataPtr!=dhcp_code_End)
{ /*== options (variable) */
tnet_dhcp_option_t* option = tnet_dhcp_option_deserialize(dataPtr, (dataEnd-dataPtr)); while(dataPtr<dataEnd && *dataPtr!=dhcp_code_End)
if(option && option->value){ {
tnet_dhcp_option_t* option = tnet_dhcp_option_deserialize(dataPtr, (dataEnd-dataPtr));
if(option->code == dhcp_code_DHCP_Msg_Type){ if(option && option->value){
message->type = (tnet_dhcp_message_type_t)*TSK_BUFFER_TO_U8(option->value);
} if(option->code == dhcp_code_DHCP_Msg_Type){
message->type = (tnet_dhcp_message_type_t)*TSK_BUFFER_TO_U8(option->value);
dataPtr += option->value->size + 2/*Code Len*/; }
tsk_list_push_back_data(message->options, (void**)&option);
} dataPtr += option->value->size + 2/*Code Len*/;
else break; tsk_list_push_back_data(message->options, (void**)&option);
} }
else break;
bail: }
return message;
} bail:
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; const tnet_dhcp_option_t* tnet_dhcp_message_find_option(const tnet_dhcp_message_t *message, tnet_dhcp_option_code_t code)
{
if(!message){ tsk_list_item_t *item;
goto bail;
} if(!message){
goto bail;
tsk_list_foreach(item, message->options) }
{
if(((tnet_dhcp_option_t*)item->data)->code == code){ tsk_list_foreach(item, message->options)
return ((tnet_dhcp_option_t*)item->data); {
} if(((tnet_dhcp_option_t*)item->data)->code == code){
} return ((tnet_dhcp_option_t*)item->data);
}
bail: }
return 0;
} 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; int tnet_dhcp_message_add_codes(tnet_dhcp_message_t *self, tnet_dhcp_option_code_t codes[], unsigned codes_count)
{
if(!self){ int ret = -1;
goto bail;
} if(!self){
if(codes_count){ goto bail;
unsigned i; }
if(codes_count){
tnet_dhcp_option_paramslist_t* option = (tnet_dhcp_option_paramslist_t*)tnet_dhcp_message_find_option(self, dhcp_code_Parameter_List); unsigned i;
if(!option){
tnet_dhcp_option_paramslist_t *option_paramslist = TNET_DHCP_OPTION_PARAMSLIST_CREATE(); tnet_dhcp_option_paramslist_t* option = (tnet_dhcp_option_paramslist_t*)tnet_dhcp_message_find_option(self, dhcp_code_Parameter_List);
option = option_paramslist; if(!option){
tsk_list_push_back_data(self->options, (void**)&option_paramslist); 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; for(i=0; i<codes_count; i++){
} if((ret = tnet_dhcp_option_paramslist_add_code(option, codes[i]))){
} break;
} }
}
bail: }
return ret;
} bail:
return ret;
}
//================================================================================================= //=================================================================================================
// [[DHCP MESSAGE]] object definition // [[DHCP MESSAGE]] object definition
// //

View File

@ -1,224 +1,226 @@
/* /*
* Copyright (C) 2009 Mamadou Diop. * Copyright (C) 2009 Mamadou Diop.
* *
* Contact: Mamadou Diop <diopmamadou@yahoo.fr> * Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* *
* This file is part of Open Source Doubango Framework. * This file is part of Open Source Doubango Framework.
* *
* DOUBANGO is free software: you can redistribute it and/or modify * DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* DOUBANGO is distributed in the hope that it will be useful, * DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with DOUBANGO. * along with DOUBANGO.
* *
*/ */
/**@file tnet_dhcp_message.h /**@file tnet_dhcp_message.h
* @brief DHCP Message as per RFC 2131 subclause 2. * @brief DHCP Message as per RFC 2131 subclause 2.
* *
* @author Mamadou Diop <diopmamadou(at)yahoo.fr> * @author Mamadou Diop <diopmamadou(at)yahoo.fr>
* *
* @date Created: Sat Nov 8 16:54:58 2009 mdiop * @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/ */
#ifndef TNET_DHCP_MESSAGE_H #ifndef TNET_DHCP_MESSAGE_H
#define TNET_DHCP_MESSAGE_H #define TNET_DHCP_MESSAGE_H
#include "tinyNET_config.h" #include "tinyNET_config.h"
#include "tnet_dhcp_option.h" #include "tnet_dhcp_option.h"
#include "tnet_hardwares.h" #include "tnet_hardwares.h"
#include "tsk_buffer.h" #include "tsk_buffer.h"
TNET_BEGIN_DECLS TNET_BEGIN_DECLS
#define TNET_DHCP_MESSAGE_CREATE(opcode) tsk_object_new(tnet_dhcp_message_def_t, (tnet_dhcp_message_op_t)opcode) struct tnet_dhcp_ctx_s;
#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_MESSAGE_CREATE(opcode) tsk_object_new(tnet_dhcp_message_def_t, (tnet_dhcp_message_op_t)opcode)
#define TNET_DHCP_REQUEST_CREATE() TNET_DHCP_MESSAGE_CREATE(dhcp_op_bootrequest)
#define TNET_DHCP_MESSAGE_IS_REQUEST(self) ((self) && ((self)->op==dhcp_op_bootrequest)) #define TNET_DHCP_REPLY_CREATE() TNET_DHCP_MESSAGE_CREATE(dhcp_op_bootreply)
#define TNET_DHCP_MESSAGE_IS_REPLY(self) ((self) && ((self)->op==dhcp_op_bootreply))
#define TNET_DHCP_MESSAGE_IS_REQUEST(self) ((self) && ((self)->op==dhcp_op_bootrequest))
#define TNET_DHCP_MAGIC_COOKIE 0x63825363 /**< DHCP magic cookie (99, 130, 83 and 99 in decimal).*/ #define TNET_DHCP_MESSAGE_IS_REPLY(self) ((self) && ((self)->op==dhcp_op_bootreply))
#define TNET_DHCP_MESSAGE_MIN_SIZE 223 /* Is it rigth? */ #define TNET_DHCP_MAGIC_COOKIE 0x63825363 /**< DHCP magic cookie (99, 130, 83 and 99 in decimal).*/
/** List of all supported DHCP message (see RFC 2131). #define TNET_DHCP_MESSAGE_MIN_SIZE 223 /* Is it rigth? */
*/
typedef enum tnet_dhcp_message_type_e /** List of all supported DHCP message (see RFC 2131).
{ */
/**< DHCPDISCOVER - Client broadcast to locate available servers. typedef enum tnet_dhcp_message_type_e
*/ {
dhcp_type_discover = 1, /**< DHCPDISCOVER - Client broadcast to locate available servers.
*/
/**< DHCPOFFER - Server to client in response to DHCPDISCOVER with dhcp_type_discover = 1,
offer of configuration parameters.
*/ /**< DHCPOFFER - Server to client in response to DHCPDISCOVER with
dhcp_type_offer = 2, offer of configuration parameters.
*/
/**< DHCPREQUEST - Client message to servers either (a) requesting dhcp_type_offer = 2,
offered parameters from one server and implicitly
declining offers from all others, (b) confirming /**< DHCPREQUEST - Client message to servers either (a) requesting
correctness of previously allocated address after, offered parameters from one server and implicitly
e.g., system reboot, or (c) extending the lease on a declining offers from all others, (b) confirming
particular network address. correctness of previously allocated address after,
*/ e.g., system reboot, or (c) extending the lease on a
dhcp_type_request = 3, particular network address.
*/
/**< DHCPDECLINE - Client to server indicating network address is already dhcp_type_request = 3,
in use.
*/ /**< DHCPDECLINE - Client to server indicating network address is already
dhcp_type_decline = 4, in use.
*/
/**< DHCPACK - Server to client with configuration parameters, dhcp_type_decline = 4,
including committed network address.
*/ /**< DHCPACK - Server to client with configuration parameters,
dhcp_type_ack = 5, including committed network address.
*/
/**< DHCPNAK - Server to client indicating client's notion of network dhcp_type_ack = 5,
address is incorrect (e.g., client has moved to new
subnet) or client's lease as expired /**< DHCPNAK - Server to client indicating client's notion of network
*/ address is incorrect (e.g., client has moved to new
dhcp_type_nack = 6, subnet) or client's lease as expired
*/
/**< DHCPRELEASE - Client to server relinquishing network address and dhcp_type_nack = 6,
cancelling remaining lease.
*/ /**< DHCPRELEASE - Client to server relinquishing network address and
dhcp_type_release = 7, cancelling remaining lease.
*/
/**< DHCPINFORM - Client to server, asking only for local configuration dhcp_type_release = 7,
parameters; client already has externally configured
network address. /**< DHCPINFORM - Client to server, asking only for local configuration
*/ parameters; client already has externally configured
dhcp_type_inform = 8, network address.
} */
tnet_dhcp_message_type_t; dhcp_type_inform = 8,
}
/** DHCP message OP code / message type. tnet_dhcp_message_type_t;
*/
typedef enum tnet_dhcp_message_op_e /** DHCP message OP code / message type.
{ */
dhcp_op_bootrequest = 1, typedef enum tnet_dhcp_message_op_e
dhcp_op_bootreply = 2 {
} dhcp_op_bootrequest = 1,
tnet_dhcp_message_op_t; dhcp_op_bootreply = 2
}
/** BOOTP/DHCP message as per RFC 2131 subclause 2. tnet_dhcp_message_op_t;
*/
typedef struct tnet_dhcp_message_s /** BOOTP/DHCP message as per RFC 2131 subclause 2.
{ */
TSK_DECLARE_OBJECT; typedef struct tnet_dhcp_message_s
{
/**< DHCP message type. Mandatory. TSK_DECLARE_OBJECT;
*/
tnet_dhcp_message_type_t type; /**< DHCP message type. Mandatory.
/* */
0 1 2 3 tnet_dhcp_message_type_t type;
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
| op (1) | htype (1) | hlen (1) | hops (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
+---------------+---------------+---------------+---------------+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| xid (4) | | op (1) | htype (1) | hlen (1) | hops (1) |
+-------------------------------+-------------------------------+ +---------------+---------------+---------------+---------------+
| secs (2) | flags (2) | | xid (4) |
+-------------------------------+-------------------------------+ +-------------------------------+-------------------------------+
| ciaddr (4) | | secs (2) | flags (2) |
+---------------------------------------------------------------+ +-------------------------------+-------------------------------+
| yiaddr (4) | | ciaddr (4) |
+---------------------------------------------------------------+ +---------------------------------------------------------------+
| siaddr (4) | | yiaddr (4) |
+---------------------------------------------------------------+ +---------------------------------------------------------------+
| giaddr (4) | | siaddr (4) |
+---------------------------------------------------------------+ +---------------------------------------------------------------+
| | | giaddr (4) |
| chaddr (16) | +---------------------------------------------------------------+
| | | |
| | | chaddr (16) |
+---------------------------------------------------------------+ | |
| | | |
| sname (64) | +---------------------------------------------------------------+
+---------------------------------------------------------------+ | |
| | | sname (64) |
| file (128) | +---------------------------------------------------------------+
+---------------------------------------------------------------+ | |
| | | file (128) |
| options (variable) | +---------------------------------------------------------------+
+---------------------------------------------------------------+ | |
*/ | options (variable) |
+---------------------------------------------------------------+
/**< Message op code / message type (1-byte). */
1 = BOOTREQUEST, 2 = BOOTREPLY
*/ /**< Message op code / message type (1-byte).
tnet_dhcp_message_op_t op; 1 = BOOTREQUEST, 2 = BOOTREPLY
/**< Hardware address type, see ARP section in "Assigned Numbers" RFC; e.g., '1' = 10mb ethernet. */
For more information see RFC 1340. tnet_dhcp_message_op_t op;
*/ /**< Hardware address type, see ARP section in "Assigned Numbers" RFC; e.g., '1' = 10mb ethernet.
tnet_hardware_type_t htype; For more information see RFC 1340.
/**< Hardware address length (e.g. '6' for 10mb ethernet). strlen(chaddr). */
*/ tnet_hardware_type_t htype;
uint8_t hlen; /**< Hardware address length (e.g. '6' for 10mb ethernet). strlen(chaddr).
/**< Client sets to zero, optionally used by relay agents when booting via a relay agent. */
*/ uint8_t hlen;
uint8_t hops; /**< Client sets to zero, optionally used by relay agents when booting via a relay agent.
/**< Transaction ID, a random number chosen by the client, used by the client */
and server to associate messages and responses between a client and a server. uint8_t hops;
*/ /**< Transaction ID, a random number chosen by the client, used by the client
uint32_t xid; and server to associate messages and responses between a client and a server.
/**< Filled in by client, seconds elapsed since client began address acquisition or renewal process. */
*/ uint32_t xid;
uint16_t secs; /**< Filled in by client, seconds elapsed since client began address acquisition or renewal process.
/**< Flags (see figure 2) */
*/ uint16_t secs;
uint16_t flags; /**< Flags (see figure 2)
/**< Client IP address; only filled in if client is in BOUND, RENEW or REBINDING */
state and can respond to ARP requests. uint16_t flags;
*/ /**< Client IP address; only filled in if client is in BOUND, RENEW or REBINDING
uint32_t ciaddr; state and can respond to ARP requests.
/**< 'your' (client) IP address. */
*/ uint32_t ciaddr;
uint32_t yiaddr; /**< 'your' (client) IP address.
/**< IP address of next server to use in bootstrap; */
returned in DHCPOFFER, DHCPACK by server. uint32_t yiaddr;
*/ /**< IP address of next server to use in bootstrap;
uint32_t siaddr; returned in DHCPOFFER, DHCPACK by server.
/**< Relay agent IP address, used in booting via a relay agent. */
*/ uint32_t siaddr;
uint32_t giaddr; /**< Relay agent IP address, used in booting via a relay agent.
/**< Client hardware address. */
*/ uint32_t giaddr;
uint8_t chaddr[16]; /**< Client hardware address.
/**< Optional server host name, null terminated string. */
*/ uint8_t chaddr[16];
uint8_t sname[64]; /**< Optional server host name, null terminated string.
/**<Boot file name, null terminated string; "generic" name or null in DHCPDISCOVER, */
fully qualifieddirectory-path name in DHCPOFFER. uint8_t sname[64];
*/ /**<Boot file name, null terminated string; "generic" name or null in DHCPDISCOVER,
uint8_t file[128]; fully qualifieddirectory-path name in DHCPOFFER.
/**Optional parameters field. See the options documents for a list of defined options. */
For more information please refer to RFC 2132, 1497 and 1533. uint8_t file[128];
*/ /**Optional parameters field. See the options documents for a list of defined options.
tnet_dhcp_options_L_t *options; For more information please refer to RFC 2132, 1497 and 1533.
} */
tnet_dhcp_message_t; tnet_dhcp_options_L_t *options;
}
typedef tsk_list_t tnet_dhcp_messages_L_t; tnet_dhcp_message_t;
typedef tnet_dhcp_message_t tnet_dhcp_request_t; /**< BOOTREQUEST message. */
typedef tnet_dhcp_message_t tnet_dhcp_reply_t; /**< BOOTREPLY message. */ typedef tsk_list_t tnet_dhcp_messages_L_t;
typedef tnet_dhcp_message_t tnet_dhcp_request_t; /**< BOOTREQUEST message. */
tsk_buffer_t* tnet_dhcp_message_serialize(const struct tnet_dhcp_ctx_s *ctx, const tnet_dhcp_message_t *self); typedef tnet_dhcp_message_t tnet_dhcp_reply_t; /**< BOOTREPLY message. */
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); tsk_buffer_t* tnet_dhcp_message_serialize(const struct tnet_dhcp_ctx_s *ctx, const tnet_dhcp_message_t *self);
int tnet_dhcp_message_add_codes(tnet_dhcp_message_t *self, tnet_dhcp_option_code_t codes[], unsigned codes_count); 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);
TINYNET_GEXTERN const void *tnet_dhcp_message_def_t; int tnet_dhcp_message_add_codes(tnet_dhcp_message_t *self, tnet_dhcp_option_code_t codes[], unsigned codes_count);
TNET_END_DECLS TINYNET_GEXTERN const void *tnet_dhcp_message_def_t;
#endif /* TNET_DHCP_MESSAGE_H */ TNET_END_DECLS
#endif /* TNET_DHCP_MESSAGE_H */

View File

@ -31,6 +31,8 @@
#include "tsk_debug.h" #include "tsk_debug.h"
#include <string.h>
tsk_buffer_t* tnet_dhcp6_message_serialize(const tnet_dhcp6_ctx_t *ctx, const tnet_dhcp6_message_t *self) tsk_buffer_t* tnet_dhcp6_message_serialize(const tnet_dhcp6_ctx_t *ctx, const tnet_dhcp6_message_t *self)
{ {
tsk_buffer_t* output = 0; tsk_buffer_t* output = 0;
@ -53,7 +55,7 @@ tsk_buffer_t* tnet_dhcp6_message_serialize(const tnet_dhcp6_ctx_t *ctx, const tn
/*== Vendor class /*== Vendor class
*/ */
{ {
_2bytes = htons(dhcp6_code_vendor_class); _2bytes = htons(dhcp6_code_vendor_class);
tsk_buffer_append(output, &(_2bytes), 2); tsk_buffer_append(output, &(_2bytes), 2);
_2bytes = htons(4 + strlen(ctx->vendor_class_data)); _2bytes = htons(4 + strlen(ctx->vendor_class_data));
tsk_buffer_append(output, &(_2bytes), 2); tsk_buffer_append(output, &(_2bytes), 2);
@ -86,38 +88,38 @@ tnet_dhcp6_message_t* tnet_dhcp6_message_deserialize(const tnet_dhcp6_ctx_t *ctx
//================================================================================================= //=================================================================================================
// [[DHCPv6 MESSAGE]] object definition // [[DHCPv6 MESSAGE]] object definition
// //
static void* tnet_dhcp6_message_create(void * self, va_list * app) static void* tnet_dhcp6_message_create(void * self, va_list * app)
{ {
tnet_dhcp6_message_t *message = self; tnet_dhcp6_message_t *message = self;
if(message) if(message)
{ {
static uint16_t __dhcp6message_unique_tid = 0;//(uint32_t)tsk_time_epoch(); static uint16_t __dhcp6message_unique_tid = 0;//(uint32_t)tsk_time_epoch();
message->type = va_arg(*app, tnet_dhcp6_message_type_t); message->type = va_arg(*app, tnet_dhcp6_message_type_t);
message->transaction_id = ++__dhcp6message_unique_tid; message->transaction_id = ++__dhcp6message_unique_tid;
message->options = TSK_LIST_CREATE(); message->options = TSK_LIST_CREATE();
} }
return self; return self;
} }
static void* tnet_dhcp6_message_destroy(void * self) static void* tnet_dhcp6_message_destroy(void * self)
{ {
tnet_dhcp6_message_t *message = self; tnet_dhcp6_message_t *message = self;
if(message) if(message)
{ {
TSK_OBJECT_SAFE_FREE(message->options); TSK_OBJECT_SAFE_FREE(message->options);
} }
return self; return self;
} }
static const tsk_object_def_t tnet_dhcp6_message_def_s = static const tsk_object_def_t tnet_dhcp6_message_def_s =
{ {
sizeof(tnet_dhcp6_message_t), sizeof(tnet_dhcp6_message_t),
tnet_dhcp6_message_create, tnet_dhcp6_message_create,
tnet_dhcp6_message_destroy, tnet_dhcp6_message_destroy,
0, 0,
}; };
const void *tnet_dhcp6_message_def_t = &tnet_dhcp6_message_def_s; const void *tnet_dhcp6_message_def_t = &tnet_dhcp6_message_def_s;

View File

@ -37,6 +37,8 @@
TNET_BEGIN_DECLS TNET_BEGIN_DECLS
struct tnet_dhcp6_ctx_s;
#define TNET_DHCP6_MESSAGE_CREATE(type) tsk_object_new(tnet_dhcp6_message_def_t, (tnet_dhcp6_message_type_t)type) #define TNET_DHCP6_MESSAGE_CREATE(type) tsk_object_new(tnet_dhcp6_message_def_t, (tnet_dhcp6_message_type_t)type)
#define TNET_DHCP6_REQUEST_CREATE(type) TNET_DHCP6_MESSAGE_CREATE(type) #define TNET_DHCP6_REQUEST_CREATE(type) TNET_DHCP6_MESSAGE_CREATE(type)

View File

@ -68,7 +68,7 @@ tnet_dhcp6_option_t* tnet_dhcp6_option_deserialize(const void* data, size_t size
{ {
tnet_dhcp6_option_t *option = 0; tnet_dhcp6_option_t *option = 0;
uint8_t* dataPtr = ((uint8_t*)data); uint8_t* dataPtr = ((uint8_t*)data);
uint8_t* dataEnd = (dataPtr+size); //uint8_t* dataEnd = (dataPtr+size);
tnet_dhcp6_option_code_t code; tnet_dhcp6_option_code_t code;
uint16_t len; uint16_t len;
@ -106,15 +106,15 @@ int tnet_dhcp6_option_serialize(const tnet_dhcp6_option_t* self, tsk_buffer_t *o
uint16_t _2bytes; uint16_t _2bytes;
int ret = -1; int ret = -1;
if(!self || !output){ if(!self || !output){
goto bail; goto bail;
} }
/*== Code /*== Code
*/ */
_2bytes = htons(self->code); _2bytes = htons(self->code);
tsk_buffer_append(output, &(_2bytes), 2); tsk_buffer_append(output, &(_2bytes), 2);
switch(self->code) switch(self->code)
{ {
case dhcp6_code_clientid: case dhcp6_code_clientid:
@ -129,7 +129,7 @@ int tnet_dhcp6_option_serialize(const tnet_dhcp6_option_t* self, tsk_buffer_t *o
if(self->data && self->data->size) if(self->data && self->data->size)
{ {
/* option-len */ /* option-len */
_2bytes = htons(self->data->size); _2bytes = htons(self->data->size);
tsk_buffer_append(output, &(_2bytes), 2); tsk_buffer_append(output, &(_2bytes), 2);
/* option-data */ /* option-data */
ret = tsk_buffer_append(output, self->data->data, self->data->size); ret = tsk_buffer_append(output, self->data->data, self->data->size);

View File

@ -176,8 +176,6 @@ typedef tnet_dhcp6_option_identifier_t tnet_dhcp6_option_serverid_t;
* RFC 3315 - 22.7. Option Request Option * RFC 3315 - 22.7. Option Request Option
*=======================================================================================*/ *=======================================================================================*/
TINYNET_API int tnet_dhcp6_option_orequest_add_code(struct tnet_dhcp6_option_orequest_s* self, uint16_t code);
/** DHCPv6 Option Request Option (subclause 22.7). /** DHCPv6 Option Request Option (subclause 22.7).
*/ */
typedef struct tnet_dhcp6_option_orequest_s typedef struct tnet_dhcp6_option_orequest_s
@ -197,6 +195,8 @@ typedef struct tnet_dhcp6_option_orequest_s
} }
tnet_dhcp6_option_orequest_t; tnet_dhcp6_option_orequest_t;
TINYNET_API int tnet_dhcp6_option_orequest_add_code(tnet_dhcp6_option_orequest_t* self, uint16_t code);
/*====================================================================================== /*======================================================================================
* RFC 3315 - 22.16. Vendor Class Option * RFC 3315 - 22.16. Vendor Class Option
*=======================================================================================*/ *=======================================================================================*/

View File

@ -331,7 +331,7 @@ int tnet_dns_query_naptr_srv(tnet_dns_ctx_t *ctx, const char* domain, const char
TSK_OBJECT_SAFE_FREE(response); TSK_OBJECT_SAFE_FREE(response);
return (hostname && !tsk_strempty(*hostname)) ? 0 : -2; return (hostname && *hostname && !tsk_strempty(*hostname)) ? 0 : -2;
} }
int tnet_dns_cache_maintenance(tnet_dns_ctx_t *ctx) int tnet_dns_cache_maintenance(tnet_dns_ctx_t *ctx)

View File

@ -125,8 +125,8 @@ typedef struct tnet_stun_binding_s
tnet_stun_attribute_mapped_addr_t *maddr; tnet_stun_attribute_mapped_addr_t *maddr;
//! XORed server reflexive address (STUN2 as per RFC 5389). //! XORed server reflexive address (STUN2 as per RFC 5389).
tnet_stun_attribute_xmapped_addr_t *xmaddr; tnet_stun_attribute_xmapped_addr_t *xmaddr;
} }tnet_stun_binding_t;
tnet_stun_binding_t;
TINYNET_GEXTERN const void *tnet_stun_binding_def_t; TINYNET_GEXTERN const void *tnet_stun_binding_def_t;
/** /**
* @typedef tsk_list_t tnet_stun_bindings_L_t * @typedef tsk_list_t tnet_stun_bindings_L_t

View File

@ -1,437 +1,439 @@
/* /*
* Copyright (C) 2009 Mamadou Diop. * Copyright (C) 2009 Mamadou Diop.
* *
* Contact: Mamadou Diop <diopmamadou@yahoo.fr> * Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* *
* This file is part of Open Source Doubango Framework. * This file is part of Open Source Doubango Framework.
* *
* DOUBANGO is free software: you can redistribute it and/or modify * DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* DOUBANGO is distributed in the hope that it will be useful, * DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with DOUBANGO. * along with DOUBANGO.
* *
*/ */
/**@file tnet_stun_message.c /**@file tnet_stun_message.c
* @brief STUN2 (RFC 5389) message parser. * @brief STUN2 (RFC 5389) message parser.
* *
* @author Mamadou Diop <diopmamadou(at)yahoo.fr> * @author Mamadou Diop <diopmamadou(at)yahoo.fr>
* *
* @date Created: Sat Nov 8 16:54:58 2009 mdiop * @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/ */
#include "tnet_stun_message.h" #include "tnet_stun_message.h"
#include "tnet_stun.h" #include "tnet_stun.h"
#include "../tnet_types.h" #include "../tnet_types.h"
#include "../turn/tnet_turn_attribute.h" #include "../turn/tnet_turn_attribute.h"
#include "tsk_memory.h" #include "tsk_memory.h"
#include "tsk_hmac.h" #include "tsk_hmac.h"
#include "tsk_string.h" #include "tsk_string.h"
#include "tsk_ppfcs32.h" #include "tsk_ppfcs32.h"
#define SERIALIZE_N_ADD_ATTRIBUTE(ATT_NAME, payload, payload_size) \ #include <string.h>
attribute = TNET_STUN_ATTRIBUTE_##ATT_NAME##_CREATE(payload, payload_size); \
tnet_stun_attribute_serialize(attribute, output); \ #define SERIALIZE_N_ADD_ATTRIBUTE(ATT_NAME, payload, payload_size) \
tnet_stun_attribute_pad(attribute, output); \ attribute = TNET_STUN_ATTRIBUTE_##ATT_NAME##_CREATE(payload, payload_size); \
TSK_OBJECT_SAFE_FREE(attribute); tnet_stun_attribute_serialize(attribute, output); \
tnet_stun_attribute_pad(attribute, output); \
//int tnet_stun_message_set_type(tnet_stun_message_t *message, tnet_stun_message_type_t type) TSK_OBJECT_SAFE_FREE(attribute);
//{
// tnet_stun_message_t* msg = message; //int tnet_stun_message_set_type(tnet_stun_message_t *message, tnet_stun_message_type_t type)
// if(message) //{
// { // tnet_stun_message_t* msg = message;
// msg->type = type; // if(message)
// return 0; // {
// } // msg->type = type;
// return -1; // return 0;
//} // }
// return -1;
//int tnet_stun_message_set_random_transacid(tnet_stun_message_handle_t *message) //}
//{
// tnet_stun_message_t* msg = message; //int tnet_stun_message_set_random_transacid(tnet_stun_message_handle_t *message)
// if(msg) //{
// { // tnet_stun_message_t* msg = message;
// tsk_istr_t random; // if(msg)
// tsk_md5digest_t digest; // {
// // tsk_istr_t random;
// tsk_strrandom(&random); // tsk_md5digest_t digest;
// TSK_MD5_DIGEST_CALC(random, sizeof(random), digest); //
// // tsk_strrandom(&random);
// memcpy(msg->transaction_id, digest, TNET_STUN_TRANSACID_SIZE); // TSK_MD5_DIGEST_CALC(random, sizeof(random), digest);
// return 0; //
// } // memcpy(msg->transaction_id, digest, TNET_STUN_TRANSACID_SIZE);
// return -1; // return 0;
//} // }
// return -1;
//}
/**
* @fn tsk_buffer_t* tnet_stun_message_serialize(const tnet_stun_message_t *self)
* /**
* @brief Serialize a STUN message into binary data. * @fn tsk_buffer_t* tnet_stun_message_serialize(const tnet_stun_message_t *self)
* *
* @author Mamadou * @brief Serialize a STUN message into binary data.
* @date 1/14/2010 *
* * @author Mamadou
* @param [in,out] self The STUN message to serialize. * @date 1/14/2010
* *
* @return A buffer holding the binary data (result) if serialization succeed and zero otherwise. * @param [in,out] self The STUN message to serialize.
* It is up to the caller of this method to free the returned buffer using @ref TSK_BUFFER_SAFE_FREE. *
**/ * @return A buffer holding the binary data (result) if serialization succeed and zero otherwise.
tsk_buffer_t* tnet_stun_message_serialize(const tnet_stun_message_t *self) * It is up to the caller of this method to free the returned buffer using @ref TSK_BUFFER_SAFE_FREE.
{ **/
tsk_buffer_t *output = 0; tsk_buffer_t* tnet_stun_message_serialize(const tnet_stun_message_t *self)
tnet_stun_attribute_t *attribute; {
unsigned compute_integrity = self->integrity; tsk_buffer_t *output = 0;
tnet_stun_attribute_t *attribute;
if(!self) goto bail; unsigned compute_integrity = self->integrity;
output = TSK_BUFFER_CREATE_NULL(); if(!self) goto bail;
/* RFC 5389 - 6. STUN Message Structure output = TSK_BUFFER_CREATE_NULL();
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 /* RFC 5389 - 6. STUN Message Structure
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 0 1 2 3
|0 0| STUN Message Type | Message Length | 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Magic Cookie | |0 0| STUN Message Type | Message Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | Magic Cookie |
| Transaction ID (96 bits) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Transaction ID (96 bits) |
*/ | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/* STUN Message Type */
*/
{ /* STUN Message Type
uint16_t type = htons(self->type); */
tsk_buffer_append(output, &(type), 2); {
} uint16_t type = htons(self->type);
tsk_buffer_append(output, &(type), 2);
/* Message Length ==> Will be updated after attributes have been added. */ }
{
uint16_t length = 0; /* Message Length ==> Will be updated after attributes have been added. */
tsk_buffer_append(output, &(length), 2); {
} uint16_t length = 0;
tsk_buffer_append(output, &(length), 2);
/* Magic Cookie }
*/
{ /* Magic Cookie
uint32_t cookie = htonl(self->cookie); */
tsk_buffer_append(output, &(cookie), 4); {
} uint32_t cookie = htonl(self->cookie);
tsk_buffer_append(output, &(cookie), 4);
}
/* Transaction ID (96 bits==>16bytes)
*/
tsk_buffer_append(output, self->transaction_id, TNET_STUN_TRANSACID_SIZE); /* Transaction ID (96 bits==>16bytes)
*/
/* DONT-FRAGMENT tsk_buffer_append(output, self->transaction_id, TNET_STUN_TRANSACID_SIZE);
*/
if(self->dontfrag) /* DONT-FRAGMENT
{ */
attribute = TNET_TURN_ATTRIBUTE_DONTFRAG_CREATE(); if(self->dontfrag)
tnet_stun_attribute_serialize(attribute, output); {
TSK_OBJECT_SAFE_FREE(attribute); attribute = TNET_TURN_ATTRIBUTE_DONTFRAG_CREATE();
} tnet_stun_attribute_serialize(attribute, output);
TSK_OBJECT_SAFE_FREE(attribute);
/*=== Attributes === }
*/
{ /*=== Attributes ===
tsk_list_item_t *item; */
tsk_list_foreach(item, self->attributes) {
{ tsk_list_item_t *item;
attribute = item->data; tsk_list_foreach(item, self->attributes)
tnet_stun_attribute_serialize(attribute, output); {
tnet_stun_attribute_pad(attribute, output); attribute = item->data;
} tnet_stun_attribute_serialize(attribute, output);
} tnet_stun_attribute_pad(attribute, output);
}
/* AUTHENTICATION */ }
if(self->realm && self->nonce)
{ /* AUTHENTICATION */
SERIALIZE_N_ADD_ATTRIBUTE(USERNAME, self->username, strlen(self->username)); if(self->realm && self->nonce)
SERIALIZE_N_ADD_ATTRIBUTE(REALM, self->realm, strlen(self->realm)); {
SERIALIZE_N_ADD_ATTRIBUTE(NONCE, self->nonce, strlen(self->nonce)); SERIALIZE_N_ADD_ATTRIBUTE(USERNAME, self->username, strlen(self->username));
SERIALIZE_N_ADD_ATTRIBUTE(REALM, self->realm, strlen(self->realm));
compute_integrity = 1; SERIALIZE_N_ADD_ATTRIBUTE(NONCE, self->nonce, strlen(self->nonce));
}
compute_integrity = 1;
/* Message Length: The message length MUST contain the size, in bytes, of the message }
not including the 20-byte STUN header.
*/ /* Message Length: The message length MUST contain the size, in bytes, of the message
{ not including the 20-byte STUN header.
uint16_t length = (output->size) - TNET_STUN_HEADER_SIZE; */
if(self->fingerprint) {
length += (2/* Type */ + 2 /* Length */+ 4 /* FINGERPRINT VALUE*/); uint16_t length = (output->size) - TNET_STUN_HEADER_SIZE;
if(self->fingerprint)
if(compute_integrity) length += (2/* Type */ + 2 /* Length */+ 4 /* FINGERPRINT VALUE*/);
length += (2/* Type */ + 2 /* Length */+ TSK_SHA1_DIGEST_SIZE /* INTEGRITY VALUE*/);
if(compute_integrity)
*(((uint16_t*)output->data)+1) = htons(length); length += (2/* Type */ + 2 /* Length */+ TSK_SHA1_DIGEST_SIZE /* INTEGRITY VALUE*/);
}
*(((uint16_t*)output->data)+1) = htons(length);
/* MESSAGE-INTEGRITY */ }
if(compute_integrity)
{ /* MESSAGE-INTEGRITY */
/* RFC 5389 - 15.4. MESSAGE-INTEGRITY if(compute_integrity)
The MESSAGE-INTEGRITY attribute contains an HMAC-SHA1 [RFC2104] of the STUN message. {
/* RFC 5389 - 15.4. MESSAGE-INTEGRITY
For long-term credentials ==> key = MD5(username ":" realm ":" SASLprep(password)) The MESSAGE-INTEGRITY attribute contains an HMAC-SHA1 [RFC2104] of the STUN message.
For short-term credentials ==> key = SASLprep(password)
FIXME: what about short term credentials? For long-term credentials ==> key = MD5(username ":" realm ":" SASLprep(password))
FIXME: what about SASLprep For short-term credentials ==> key = SASLprep(password)
*/ FIXME: what about short term credentials?
char* keystr = 0; FIXME: what about SASLprep
tsk_sha1digest_t hmac; */
tsk_md5digest_t md5; char* keystr = 0;
tsk_sha1digest_t hmac;
tsk_sprintf(&keystr, "%s:%s:%s", self->username, self->realm, self->password); tsk_md5digest_t md5;
TSK_MD5_DIGEST_CALC(keystr, strlen(keystr), md5);
hmac_sha1digest_compute(output->data, output->size, (const char*)md5, TSK_MD5_DIGEST_SIZE, hmac); tsk_sprintf(&keystr, "%s:%s:%s", self->username, self->realm, self->password);
TSK_MD5_DIGEST_CALC(keystr, strlen(keystr), md5);
SERIALIZE_N_ADD_ATTRIBUTE(INTEGRITY, hmac, TSK_SHA1_DIGEST_SIZE); hmac_sha1digest_compute(output->data, output->size, (const char*)md5, TSK_MD5_DIGEST_SIZE, hmac);
TSK_FREE(keystr); SERIALIZE_N_ADD_ATTRIBUTE(INTEGRITY, hmac, TSK_SHA1_DIGEST_SIZE);
}
TSK_FREE(keystr);
/* FINGERPRINT */ }
if(self->fingerprint)
{ /* FINGERPRINT */
/* RFC 5389 - 15.5. FINGERPRINT if(self->fingerprint)
The FINGERPRINT attribute MAY be present in all STUN messages. The {
value of the attribute is computed as the CRC-32 of the STUN message /* RFC 5389 - 15.5. FINGERPRINT
up to (but excluding) the FINGERPRINT attribute itself, XOR'ed with The FINGERPRINT attribute MAY be present in all STUN messages. The
the 32-bit value 0x5354554e value of the attribute is computed as the CRC-32 of the STUN message
*/ up to (but excluding) the FINGERPRINT attribute itself, XOR'ed with
uint32_t fingerprint = tsk_pppfcs32(TSK_PPPINITFCS32, output->data, output->size); the 32-bit value 0x5354554e
fingerprint ^= 0x5354554e; */
fingerprint = htonl(fingerprint); uint32_t fingerprint = tsk_pppfcs32(TSK_PPPINITFCS32, output->data, output->size);
fingerprint ^= 0x5354554e;
attribute = TNET_STUN_ATTRIBUTE_FINGERPRINT_CREATE(fingerprint); fingerprint = htonl(fingerprint);
tnet_stun_attribute_serialize(attribute, output);
TSK_OBJECT_SAFE_FREE(attribute); attribute = TNET_STUN_ATTRIBUTE_FINGERPRINT_CREATE(fingerprint);
} tnet_stun_attribute_serialize(attribute, output);
TSK_OBJECT_SAFE_FREE(attribute);
bail: }
return output;
} bail:
return output;
}
/**
* @fn tnet_stun_message_t message* tnet_stun_message_deserialize(const uint8_t *data,
* size_t size) /**
* * @fn tnet_stun_message_t message* tnet_stun_message_deserialize(const uint8_t *data,
* @brief Deserialize a STUN message from binary data. * size_t size)
* *
* @author Mamadou * @brief Deserialize a STUN message from binary data.
* @date 1/14/2010 *
* * @author Mamadou
* @param [in,out] data A pointer to the binary data. * @date 1/14/2010
* @param size The size of the binary data. *
* * @param [in,out] data A pointer to the binary data.
* @return A STUN message if deserialization succeed and zero otherwise. * @param size The size of the binary data.
**/ *
tnet_stun_message_t* tnet_stun_message_deserialize(const uint8_t *data, size_t size) * @return A STUN message if deserialization succeed and zero otherwise.
{ **/
tnet_stun_message_t *message = 0; tnet_stun_message_t* tnet_stun_message_deserialize(const uint8_t *data, size_t size)
uint8_t* dataPtr, *dataEnd; {
tnet_stun_message_t *message = 0;
uint8_t* dataPtr, *dataEnd;
if(!data || (size < TNET_STUN_HEADER_SIZE) || !TNET_IS_STUN2(data))
{
goto bail; if(!data || (size < TNET_STUN_HEADER_SIZE) || !TNET_IS_STUN2(data))
} {
goto bail;
dataPtr = (uint8_t*)data; }
dataEnd = (dataPtr + size);
dataPtr = (uint8_t*)data;
message = TNET_STUN_MESSAGE_CREATE_NULL(); dataEnd = (dataPtr + size);
/* Message Type message = TNET_STUN_MESSAGE_CREATE_NULL();
*/
message->type = (tnet_stun_message_type_t)ntohs(*((uint16_t*)dataPtr)); /* Message Type
dataPtr += 2; */
message->type = (tnet_stun_message_type_t)ntohs(*((uint16_t*)dataPtr));
/* Message Length dataPtr += 2;
*/
message->length = ntohs(*((uint16_t*)dataPtr)); /* Message Length
dataPtr += 2; */
message->length = ntohs(*((uint16_t*)dataPtr));
/* Check message validity dataPtr += 2;
*/
if((message->length + TNET_STUN_HEADER_SIZE) != size) /* Check message validity
{ */
TSK_OBJECT_SAFE_FREE(message); if((message->length + TNET_STUN_HEADER_SIZE) != size)
goto bail; {
} TSK_OBJECT_SAFE_FREE(message);
goto bail;
/* Magic Cookie }
==> already set by the constructor and checked by @ref TNET_IS_STUN2
*/ /* Magic Cookie
dataPtr += 4; ==> already set by the constructor and checked by @ref TNET_IS_STUN2
*/
/* Transaction ID dataPtr += 4;
*/
memcpy(message->transaction_id, dataPtr, TNET_STUN_TRANSACID_SIZE); /* Transaction ID
dataPtr += TNET_STUN_TRANSACID_SIZE; */
memcpy(message->transaction_id, dataPtr, TNET_STUN_TRANSACID_SIZE);
/* == Parse attributes dataPtr += TNET_STUN_TRANSACID_SIZE;
*/
while(dataPtr < dataEnd) /* == Parse attributes
{ */
tnet_stun_attribute_t *attribute = tnet_stun_attribute_deserialize(dataPtr, (dataEnd - dataPtr)); while(dataPtr < dataEnd)
if(attribute) {
{ tnet_stun_attribute_t *attribute = tnet_stun_attribute_deserialize(dataPtr, (dataEnd - dataPtr));
size_t att_size = (attribute->length + 2 /* Type*/ + 2/* Length */); if(attribute)
att_size += (att_size%4) ? 4-(att_size%4) : 0; // Skip zero bytes used to pad the attribute. {
size_t att_size = (attribute->length + 2 /* Type*/ + 2/* Length */);
dataPtr += att_size; att_size += (att_size%4) ? 4-(att_size%4) : 0; // Skip zero bytes used to pad the attribute.
tsk_list_push_back_data(message->attributes, (void**)&attribute);
dataPtr += att_size;
continue; tsk_list_push_back_data(message->attributes, (void**)&attribute);
}
else continue; continue;
}
else continue;
}
}
bail:
return message;
} bail:
return message;
int tnet_stun_message_add_attribute(tnet_stun_message_t *self, tnet_stun_attribute_t** attribute) }
{
//if(self && attribute) int tnet_stun_message_add_attribute(tnet_stun_message_t *self, tnet_stun_attribute_t** attribute)
{ {
tsk_list_push_back_data(self->attributes, (void**)attribute); //if(self && attribute)
return 0; {
} tsk_list_push_back_data(self->attributes, (void**)attribute);
return -1; return 0;
} }
return -1;
const tnet_stun_attribute_t* tnet_stun_message_get_attribute(const tnet_stun_message_t *self, tnet_stun_attribute_type_t type) }
{
tnet_stun_attribute_t* attribute; const tnet_stun_attribute_t* tnet_stun_message_get_attribute(const tnet_stun_message_t *self, tnet_stun_attribute_type_t type)
{
if(self && !TSK_LIST_IS_EMPTY(self->attributes)) tnet_stun_attribute_t* attribute;
{
tsk_list_item_t *item; if(self && !TSK_LIST_IS_EMPTY(self->attributes))
tsk_list_foreach(item, self->attributes) {
{ tsk_list_item_t *item;
if((attribute = item->data) && attribute->type == type) tsk_list_foreach(item, self->attributes)
{ {
return attribute; if((attribute = item->data) && attribute->type == type)
} {
} return attribute;
} }
return 0; }
} }
return 0;
short tnet_stun_message_get_errorcode(const tnet_stun_message_t *self) }
{
const tnet_stun_attribute_errorcode_t* error = (const tnet_stun_attribute_errorcode_t*)tnet_stun_message_get_attribute(self, stun_error_code); short tnet_stun_message_get_errorcode(const tnet_stun_message_t *self)
if(error) {
{ const tnet_stun_attribute_errorcode_t* error = (const tnet_stun_attribute_errorcode_t*)tnet_stun_message_get_attribute(self, stun_error_code);
return ((error->_class*100) + error->number); if(error)
} {
return -1; return ((error->_class*100) + error->number);
} }
return -1;
const char* tnet_stun_message_get_realm(const tnet_stun_message_t *self) }
{
const tnet_stun_attribute_realm_t* realm = (const tnet_stun_attribute_realm_t*)tnet_stun_message_get_attribute(self, stun_realm); const char* tnet_stun_message_get_realm(const tnet_stun_message_t *self)
if(realm) {
{ const tnet_stun_attribute_realm_t* realm = (const tnet_stun_attribute_realm_t*)tnet_stun_message_get_attribute(self, stun_realm);
return realm->value; if(realm)
} {
return 0; return realm->value;
} }
return 0;
const char* tnet_stun_message_get_nonce(const tnet_stun_message_t *self) }
{
const tnet_stun_attribute_nonce_t* nonce = (const tnet_stun_attribute_nonce_t*)tnet_stun_message_get_attribute(self, stun_nonce); const char* tnet_stun_message_get_nonce(const tnet_stun_message_t *self)
if(nonce) {
{ const tnet_stun_attribute_nonce_t* nonce = (const tnet_stun_attribute_nonce_t*)tnet_stun_message_get_attribute(self, stun_nonce);
return nonce->value; if(nonce)
} {
return 0; return nonce->value;
} }
return 0;
int32_t tnet_stun_message_get_lifetime(const tnet_stun_message_t *self) }
{
const tnet_turn_attribute_lifetime_t* lifetime = (const tnet_turn_attribute_lifetime_t*)tnet_stun_message_get_attribute(self, stun_lifetime); int32_t tnet_stun_message_get_lifetime(const tnet_stun_message_t *self)
if(lifetime) {
{ const tnet_turn_attribute_lifetime_t* lifetime = (const tnet_turn_attribute_lifetime_t*)tnet_stun_message_get_attribute(self, stun_lifetime);
return lifetime->value; if(lifetime)
} {
return -1; return lifetime->value;
} }
return -1;
}
//=================================================================================================
// STUN2 MESSAGE object definition
// //=================================================================================================
static void* tnet_stun_message_create(void * self, va_list * app) // STUN2 MESSAGE object definition
{ //
tnet_stun_message_t *message = self; static void* tnet_stun_message_create(void * self, va_list * app)
if(message) {
{ tnet_stun_message_t *message = self;
message->username = tsk_strdup(va_arg(*app, const char*)); if(message)
message->password = tsk_strdup(va_arg(*app, const char*)); {
message->username = tsk_strdup(va_arg(*app, const char*));
message->cookie = TNET_STUN_MAGIC_COOKIE; message->password = tsk_strdup(va_arg(*app, const char*));
message->attributes = TSK_LIST_CREATE();
message->cookie = TNET_STUN_MAGIC_COOKIE;
message->fingerprint = 1; message->attributes = TSK_LIST_CREATE();
message->integrity = 0;
} message->fingerprint = 1;
return self; message->integrity = 0;
} }
return self;
static void* tnet_stun_message_destroy(void * self) }
{
tnet_stun_message_t *message = self; static void* tnet_stun_message_destroy(void * self)
if(message) {
{ tnet_stun_message_t *message = self;
TSK_FREE(message->username); if(message)
TSK_FREE(message->password); {
TSK_FREE(message->realm); TSK_FREE(message->username);
TSK_FREE(message->nonce); TSK_FREE(message->password);
TSK_FREE(message->realm);
TSK_OBJECT_SAFE_FREE(message->attributes); TSK_FREE(message->nonce);
}
TSK_OBJECT_SAFE_FREE(message->attributes);
return self; }
}
return self;
static const tsk_object_def_t tnet_stun_message_def_s = }
{
sizeof(tnet_stun_message_t), static const tsk_object_def_t tnet_stun_message_def_s =
tnet_stun_message_create, {
tnet_stun_message_destroy, sizeof(tnet_stun_message_t),
0, tnet_stun_message_create,
}; tnet_stun_message_destroy,
const void *tnet_stun_message_def_t = &tnet_stun_message_def_s; 0,
};
const void *tnet_stun_message_def_t = &tnet_stun_message_def_s;

View File

@ -1,114 +1,116 @@
/* /*
* Copyright (C) 2009 Mamadou Diop. * Copyright (C) 2009 Mamadou Diop.
* *
* Contact: Mamadou Diop <diopmamadou@yahoo.fr> * Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* *
* This file is part of Open Source Doubango Framework. * This file is part of Open Source Doubango Framework.
* *
* DOUBANGO is free software: you can redistribute it and/or modify * DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* DOUBANGO is distributed in the hope that it will be useful, * DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with DOUBANGO. * along with DOUBANGO.
* *
*/ */
/**@file tinyNET_config.h /**@file tinyNET_config.h
* @brief Global configuration file. * @brief Global configuration file.
* *
* This file incude all your preferences or configuration. All specific configuration * This file incude all your preferences or configuration. All specific configuration
* must be defined in this file. You must include this file in all your header files. * must be defined in this file. You must include this file in all your header files.
* *
* @author Mamadou Diop <diopmamadou(at)yahoo.fr> * @author Mamadou Diop <diopmamadou(at)yahoo.fr>
* *
* @date Created: Sat Nov 8 16:54:58 2009 mdiop * @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/ */
#ifndef _TINYNET_H_ #ifndef _TINYNET_H_
#define _TINYNET_H_ #define _TINYNET_H_
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
#ifdef __SYMBIAN32__ #ifdef __SYMBIAN32__
#undef _WIN32 /* Because of WINSCW */ #undef _WIN32 /* Because of WINSCW */
#endif #endif
/* Windows (XP/Vista/7/CE and Windows Mobile) macro definition. /* Windows (XP/Vista/7/CE and Windows Mobile) macro definition.
*/ */
#if defined(WIN32)|| defined(_WIN32) || defined(_WIN32_WCE) #if defined(WIN32)|| defined(_WIN32) || defined(_WIN32_WCE)
# define TNET_UNDER_WINDOWS 1 # define TNET_UNDER_WINDOWS 1
#endif #endif
/**@def TINYNET_API /**@def TINYNET_API
* Used on Windows and Sysbian systems to export public functions. * Used on Windows and Sysbian systems to export public functions.
*/ */
#if !defined(__GNUC__) && defined(TINYNET_EXPORTS) #if !defined(__GNUC__) && defined(TINYNET_EXPORTS)
# define TINYNET_API __declspec(dllexport) # define TINYNET_API __declspec(dllexport)
# define TINYNET_GEXTERN __declspec(dllexport) # define TINYNET_GEXTERN __declspec(dllexport)
#elif !defined(__GNUC__) /*&& defined(TINYNET_IMPORTS)*/ #elif !defined(__GNUC__) /*&& defined(TINYNET_IMPORTS)*/
# define TINYNET_API __declspec(dllimport) # define TINYNET_API __declspec(dllimport)
# define TINYNET_GEXTERN __declspec(dllimport) # define TINYNET_GEXTERN __declspec(dllimport)
#else #else
# define TINYNET_API # define TINYNET_API
# define TINYNET_GEXTERN extern # define TINYNET_GEXTERN extern
#endif #endif
/* Guards against C++ name mangling /* Guards against C++ name mangling
*/ */
#ifdef __cplusplus #ifdef __cplusplus
# define TNET_BEGIN_DECLS extern "C" { # define TNET_BEGIN_DECLS extern "C" {
# define TNET_END_DECLS } # define TNET_END_DECLS }
#else #else
# define TNET_BEGIN_DECLS # define TNET_BEGIN_DECLS
# define TNET_END_DECLS # define TNET_END_DECLS
#endif #endif
/* Disable some well-known warnings /* Disable some well-known warnings
*/ */
#ifdef _MSC_VER #ifdef _MSC_VER
# define _CRT_SECURE_NO_WARNINGS # define _CRT_SECURE_NO_WARNINGS
# pragma warning( disable : 4996 ) # pragma warning( disable : 4996 )
#endif #endif
#if (_WIN32_WINNT>=0x0600) || (ANDROID) || defined (__APPLE__) #if (_WIN32_WINNT>=0x0600) || (ANDROID) || defined (__APPLE__)
# define TNET_HAVE_POLL 1 # define TNET_HAVE_POLL 1
#else #else
# define TNET_HAVE_POLL 0 # define TNET_HAVE_POLL 0
#endif #endif
#if TNET_UNDER_WINDOWS #if TNET_UNDER_WINDOWS
# define TNET_USE_POLL 0 /* Do not use WSAPoll event if under Vista. */ # define TNET_USE_POLL 0 /* Do not use WSAPoll event if under Vista. */
#else #else
# define TNET_USE_POLL 1 # define TNET_USE_POLL 1
#endif #endif
#if defined(__APPLE__) /*|| defined(__SYMBIAN32__)*/ #if defined(__APPLE__) /*|| defined(__SYMBIAN32__)*/
# define TNET_HAVE_SS_LEN 1 # define TNET_HAVE_SS_LEN 1
#else # define TNET_HAVE_SA_LEN 1
# define TNET_HAVE_SS_LEN 0 #else
#endif # define TNET_HAVE_SS_LEN 0
# define TNET_HAVE_SA_LEN 0
#if 0 /* __APPLE__? */ #endif
# define HAVE_IFADDRS_H 1
#else #if defined(__APPLE__)
# define HAVE_IFADDRS_H 0 # define HAVE_IFADDRS 1
#endif #else
# define HAVE_IFADDRS 0 /* Windows, ANDROID */
/* Used in TURN/STUN2 attributes. #endif
*/
#define TNET_SOFTWARE "IM-client/OMA1.0 doubango/v0.0.0" /* Used in TURN/STUN2 attributes.
*/
#include <stdint.h> #define TNET_SOFTWARE "IM-client/OMA1.0 doubango/v0.0.0"
#endif /* _TINYNET_H_ */ #include <stdint.h>
#endif /* _TINYNET_H_ */

View File

@ -46,10 +46,9 @@
# include <fcntl.h> # include <fcntl.h>
# include <sys/ioctl.h> # include <sys/ioctl.h>
# include <unistd.h> # include <unistd.h>
# if HAVE_IFADDRS_H # include <net/if.h>
# if HAVE_IFADDRS
# include <ifaddrs.h> # include <ifaddrs.h>
# else
# include <net/if.h>
# endif # endif
# if TNET_HAVE_POLL # if TNET_HAVE_POLL
# include <poll.h> # include <poll.h>
@ -96,4 +95,4 @@ TNET_END_DECLS
#endif /* TNET_TYPES_H */ #endif /* TNET_TYPES_H */

View File

@ -153,19 +153,60 @@ tnet_interfaces_L_t* tnet_get_interfaces()
#undef FREE #undef FREE
#elif HAVE_IFADDRS_H /*=== Using getifaddrs ===*/ #elif HAVE_IFADDRS /*=== Using getifaddrs ===*/
// see http://www.kernel.org/doc/man-pages/online/pages/man3/getifaddrs.3.html // see http://www.kernel.org/doc/man-pages/online/pages/man3/getifaddrs.3.html
struct ifaddrs *ifaddr, *ifa; struct ifaddrs *ifaddr = 0, *ifa = 0;
/* Get interfaces */ /* Get interfaces */
//if(getifaddrs(&ifaddr) == -1) if(getifaddrs(&ifaddr) == -1)
{ {
TSK_DEBUG_ERROR("getifaddrs failed and errno= [%d]", tnet_geterrno()); TSK_DEBUG_ERROR("getifaddrs failed and errno= [%d]", tnet_geterrno());
goto bail; goto bail;
} }
for(ifa = ifaddr; ifa; ifa = ifa->ifa_next)
{
if(ifa->ifa_addr->sa_family != AF_LINK){
continue;
}
#ifdef __linux__
{
struct ifreq ifr;
tnet_fd_t fd = TNET_INVALID_FD;
if((fd = socket(AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP)) < 0){
TSK_DEBUG_ERROR("Failed to create new DGRAM socket and errno= [%d]", tnet_geterrno());
goto next;
}
ifr.ifr_addr.sa_family = ifa->ifa_addr->sa_family;
strcpy(ifr.ifr_name, ifa.ifa_name);
if(tnet_ioctl(fd, SIOCGIFHWADDR, &ifr)<0){
TSK_DEBUG_ERROR("tnet_ioctl(SIOCGIFHWADDR)", tnet_geterrno());
goto next;
}
else{
//sockaddr_dl* sdl = (struct sockaddr_dl *)ifa->ifa_addr;
tnet_interface_t *iface = TNET_INTERFACE_CREATE(ifr->ifr_name, ifr->ifr_hwaddr.sa_data, 6);
tsk_list_push_back_data(ifaces, (void**)&(iface));
}
next:
tnet_sockfd_close(&fd);
}
#else
{
//struct sockaddr_dl* sdl = (struct sockaddr_dl*)ifa->ifa_addr;
tnet_interface_t *iface = TNET_INTERFACE_CREATE(ifa->ifa_name, ifa->ifa_addr, 6);
iface->index = if_nametoindex(ifa->ifa_name);
tsk_list_push_back_data(ifaces, (void**)&(iface));
}
#endif
}/* for */
freeifaddrs(ifaddr);
#else /*=== ANDROID,... --> Using SIOCGIFCONF and SIOCGIFHWADDR ===*/ #else /*=== ANDROID,... --> Using SIOCGIFCONF and SIOCGIFHWADDR ===*/
@ -176,7 +217,7 @@ tnet_interfaces_L_t* tnet_get_interfaces()
struct sockaddr_in *sin; struct sockaddr_in *sin;
struct ifreq *ifr; struct ifreq *ifr;
if((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) if((fd = socket(AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP)) < 0)
{ {
TSK_DEBUG_ERROR("Failed to create new DGRAM socket and errno= [%d]", tnet_geterrno()); TSK_DEBUG_ERROR("Failed to create new DGRAM socket and errno= [%d]", tnet_geterrno());
goto done; goto done;
@ -524,34 +565,34 @@ int tnet_gethostname(tnet_host_t* result)
return gethostname(*result, sizeof(*result)); return gethostname(*result, sizeof(*result));
} }
int tnet_sockfd_joingroup6(tnet_fd_t fd, const char* multiaddr, unsigned iface_index) int tnet_sockfd_joingroup6(tnet_fd_t fd, const char* multiaddr, unsigned iface_index)
{ {
int ret = -1; int ret = -1;
//struct ipv6_mreq mreq6; //struct ipv6_mreq mreq6;
//struct sockaddr_storage ss; //struct sockaddr_storage ss;
//if((ret = tnet_sockaddr_init(multiaddr, 0, tnet_socket_type_udp_ipv6, &ss))) //if((ret = tnet_sockaddr_init(multiaddr, 0, tnet_socket_type_udp_ipv6, &ss)))
//{ //{
// return ret; // return ret;
//} //}
//memcpy(&mreq6.ipv6mr_multiaddr, &((struct sockaddr_in6 *) &ss)->sin6_addr, sizeof(struct in6_addr)); //memcpy(&mreq6.ipv6mr_multiaddr, &((struct sockaddr_in6 *) &ss)->sin6_addr, sizeof(struct in6_addr));
//mreq6.ipv6mr_interface = iface_index; //mreq6.ipv6mr_interface = iface_index;
//if((ret = setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, (const char*)&mreq6, sizeof(mreq6)))) //if((ret = setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, (const char*)&mreq6, sizeof(mreq6))))
//{ //{
// TNET_PRINT_LAST_ERROR("Failed to join IPv6 multicast group."); // TNET_PRINT_LAST_ERROR("Failed to join IPv6 multicast group.");
// return ret; // return ret;
//} //}
return ret; return ret;
} }
int tnet_sockfd_leavegroup6(tnet_fd_t fd, const char* multiaddr, unsigned iface_index) int tnet_sockfd_leavegroup6(tnet_fd_t fd, const char* multiaddr, unsigned iface_index)
{ {
//if(multiaddr) //if(multiaddr)
{ {
} }
return -1; return -1;
} }
@ -711,8 +752,8 @@ int tnet_sockfd_sendto(tnet_fd_t fd, const struct sockaddr *to, const void* buf,
return -2; return -2;
} }
#if TNET_HAVE_SS_LEN #if TNET_HAVE_SA_LEN
return sendto(fd, buf, size, 0, to, to->ss_len); return sendto(fd, buf, size, 0, to, to->sa_len);
#else #else
//return sendto(fd, buf, size, 0, to, sizeof(*to)); //return sendto(fd, buf, size, 0, to, sizeof(*to));
return sendto(fd, buf, size, 0, to, return sendto(fd, buf, size, 0, to,
@ -730,8 +771,8 @@ int tnet_sockfd_recvfrom(tnet_fd_t fd, void* buf, size_t size, int flags, struct
return -1; return -1;
} }
#if TNET_HAVE_SS_LEN #if TNET_HAVE_SA_LEN
fromlen = from->ss_len; fromlen = from->sa_len;
#else #else
fromlen = sizeof(*from); fromlen = sizeof(*from);
#endif #endif

View File

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

View File

@ -67,7 +67,7 @@ void test_ifaces_dump_addresses()
void test_ifaces() void test_ifaces()
{ {
test_ifaces_dump_ifaces(); test_ifaces_dump_ifaces();
test_ifaces_dump_addresses(); test_ifaces_dump_addresses();
} }

View File

@ -35,6 +35,7 @@
#include "tsk_time.h" #include "tsk_time.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
int tsk_uuidgenerate(tsk_uuidstring_t *result) int tsk_uuidgenerate(tsk_uuidstring_t *result)
{ {

File diff suppressed because it is too large Load Diff

View File

@ -7,21 +7,95 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
EC9A8D391124B7C90046F5EC /* tsk_ppfcs32.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D351124B7C90046F5EC /* tsk_ppfcs32.c */; };
EC9A8D3A1124B7C90046F5EC /* tsk_ppfcs32.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D361124B7C90046F5EC /* tsk_ppfcs32.h */; };
EC9A8D3B1124B7C90046F5EC /* tsk_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D371124B7C90046F5EC /* tsk_uuid.c */; };
EC9A8D3C1124B7C90046F5EC /* tsk_uuid.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D381124B7C90046F5EC /* tsk_uuid.h */; };
EC9A8D991124B8160046F5EC /* tnet_dhcp.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D441124B8160046F5EC /* tnet_dhcp.c */; };
EC9A8D9A1124B8160046F5EC /* tnet_dhcp.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D451124B8160046F5EC /* tnet_dhcp.h */; };
EC9A8D9B1124B8160046F5EC /* tnet_dhcp_message.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D461124B8160046F5EC /* tnet_dhcp_message.c */; };
EC9A8D9C1124B8160046F5EC /* tnet_dhcp_message.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D471124B8160046F5EC /* tnet_dhcp_message.h */; };
EC9A8D9D1124B8160046F5EC /* tnet_dhcp_option.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D481124B8160046F5EC /* tnet_dhcp_option.c */; };
EC9A8D9E1124B8160046F5EC /* tnet_dhcp_option.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D491124B8160046F5EC /* tnet_dhcp_option.h */; };
EC9A8D9F1124B8160046F5EC /* tnet_dhcp_option_sip.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D4A1124B8160046F5EC /* tnet_dhcp_option_sip.c */; };
EC9A8DA01124B8160046F5EC /* tnet_dhcp_option_sip.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D4B1124B8160046F5EC /* tnet_dhcp_option_sip.h */; };
EC9A8DA11124B8160046F5EC /* tnet_dhcp6.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D4D1124B8160046F5EC /* tnet_dhcp6.c */; };
EC9A8DA21124B8160046F5EC /* tnet_dhcp6.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D4E1124B8160046F5EC /* tnet_dhcp6.h */; };
EC9A8DA31124B8160046F5EC /* tnet_dhcp6_duid.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D4F1124B8160046F5EC /* tnet_dhcp6_duid.c */; };
EC9A8DA41124B8160046F5EC /* tnet_dhcp6_duid.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D501124B8160046F5EC /* tnet_dhcp6_duid.h */; };
EC9A8DA51124B8160046F5EC /* tnet_dhcp6_message.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D511124B8160046F5EC /* tnet_dhcp6_message.c */; };
EC9A8DA61124B8160046F5EC /* tnet_dhcp6_message.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D521124B8160046F5EC /* tnet_dhcp6_message.h */; };
EC9A8DA71124B8160046F5EC /* tnet_dhcp6_option.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D531124B8160046F5EC /* tnet_dhcp6_option.c */; };
EC9A8DA81124B8160046F5EC /* tnet_dhcp6_option.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D541124B8160046F5EC /* tnet_dhcp6_option.h */; };
EC9A8DA91124B8160046F5EC /* tnet_dns.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D561124B8160046F5EC /* tnet_dns.c */; };
EC9A8DAA1124B8160046F5EC /* tnet_dns.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D571124B8160046F5EC /* tnet_dns.h */; };
EC9A8DAB1124B8160046F5EC /* tnet_dns_a.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D581124B8160046F5EC /* tnet_dns_a.c */; };
EC9A8DAC1124B8160046F5EC /* tnet_dns_a.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D591124B8160046F5EC /* tnet_dns_a.h */; };
EC9A8DAD1124B8160046F5EC /* tnet_dns_aaaa.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D5A1124B8160046F5EC /* tnet_dns_aaaa.c */; };
EC9A8DAE1124B8160046F5EC /* tnet_dns_aaaa.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D5B1124B8160046F5EC /* tnet_dns_aaaa.h */; };
EC9A8DAF1124B8160046F5EC /* tnet_dns_cname.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D5C1124B8160046F5EC /* tnet_dns_cname.c */; };
EC9A8DB01124B8160046F5EC /* tnet_dns_cname.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D5D1124B8160046F5EC /* tnet_dns_cname.h */; };
EC9A8DB11124B8160046F5EC /* tnet_dns_message.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D5E1124B8160046F5EC /* tnet_dns_message.c */; };
EC9A8DB21124B8160046F5EC /* tnet_dns_message.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D5F1124B8160046F5EC /* tnet_dns_message.h */; };
EC9A8DB31124B8160046F5EC /* tnet_dns_mx.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D601124B8160046F5EC /* tnet_dns_mx.c */; };
EC9A8DB41124B8160046F5EC /* tnet_dns_mx.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D611124B8160046F5EC /* tnet_dns_mx.h */; };
EC9A8DB51124B8160046F5EC /* tnet_dns_naptr.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D621124B8160046F5EC /* tnet_dns_naptr.c */; };
EC9A8DB61124B8160046F5EC /* tnet_dns_naptr.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D631124B8160046F5EC /* tnet_dns_naptr.h */; };
EC9A8DB71124B8160046F5EC /* tnet_dns_ns.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D641124B8160046F5EC /* tnet_dns_ns.c */; };
EC9A8DB81124B8160046F5EC /* tnet_dns_ns.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D651124B8160046F5EC /* tnet_dns_ns.h */; };
EC9A8DB91124B8160046F5EC /* tnet_dns_opt.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D661124B8160046F5EC /* tnet_dns_opt.c */; };
EC9A8DBA1124B8160046F5EC /* tnet_dns_opt.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D671124B8160046F5EC /* tnet_dns_opt.h */; };
EC9A8DBB1124B8160046F5EC /* tnet_dns_ptr.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D681124B8160046F5EC /* tnet_dns_ptr.c */; };
EC9A8DBC1124B8160046F5EC /* tnet_dns_ptr.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D691124B8160046F5EC /* tnet_dns_ptr.h */; };
EC9A8DBD1124B8160046F5EC /* tnet_dns_rr.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D6A1124B8160046F5EC /* tnet_dns_rr.c */; };
EC9A8DBE1124B8160046F5EC /* tnet_dns_rr.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D6B1124B8160046F5EC /* tnet_dns_rr.h */; };
EC9A8DBF1124B8160046F5EC /* tnet_dns_soa.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D6C1124B8160046F5EC /* tnet_dns_soa.c */; };
EC9A8DC01124B8160046F5EC /* tnet_dns_soa.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D6D1124B8160046F5EC /* tnet_dns_soa.h */; };
EC9A8DC11124B8160046F5EC /* tnet_dns_srv.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D6E1124B8160046F5EC /* tnet_dns_srv.c */; };
EC9A8DC21124B8160046F5EC /* tnet_dns_srv.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D6F1124B8160046F5EC /* tnet_dns_srv.h */; };
EC9A8DC31124B8160046F5EC /* tnet_dns_txt.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D701124B8160046F5EC /* tnet_dns_txt.c */; };
EC9A8DC41124B8160046F5EC /* tnet_dns_txt.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D711124B8160046F5EC /* tnet_dns_txt.h */; };
EC9A8DC51124B8160046F5EC /* tnet_ice.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D731124B8160046F5EC /* tnet_ice.c */; };
EC9A8DC61124B8160046F5EC /* tnet_ice.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D741124B8160046F5EC /* tnet_ice.h */; };
EC9A8DC81124B8160046F5EC /* tnet_stun.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D781124B8160046F5EC /* tnet_stun.c */; };
EC9A8DC91124B8160046F5EC /* tnet_stun.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D791124B8160046F5EC /* tnet_stun.h */; };
EC9A8DCA1124B8160046F5EC /* tnet_stun_attribute.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D7A1124B8160046F5EC /* tnet_stun_attribute.c */; };
EC9A8DCB1124B8160046F5EC /* tnet_stun_attribute.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D7B1124B8160046F5EC /* tnet_stun_attribute.h */; };
EC9A8DCC1124B8160046F5EC /* tnet_stun_message.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D7C1124B8160046F5EC /* tnet_stun_message.c */; };
EC9A8DCD1124B8160046F5EC /* tnet_stun_message.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D7D1124B8160046F5EC /* tnet_stun_message.h */; };
EC9A8DCE1124B8160046F5EC /* tinyNET_config.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D7E1124B8160046F5EC /* tinyNET_config.h */; };
EC9A8DCF1124B8160046F5EC /* tnet.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D7F1124B8160046F5EC /* tnet.c */; };
EC9A8DD01124B8160046F5EC /* tnet.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D801124B8160046F5EC /* tnet.h */; };
EC9A8DD11124B8160046F5EC /* tnet_auth.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D811124B8160046F5EC /* tnet_auth.c */; };
EC9A8DD21124B8160046F5EC /* tnet_auth.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D821124B8160046F5EC /* tnet_auth.h */; };
EC9A8DD31124B8160046F5EC /* tnet_hardwares.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D831124B8160046F5EC /* tnet_hardwares.h */; };
EC9A8DD41124B8160046F5EC /* tnet_nat.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D841124B8160046F5EC /* tnet_nat.c */; };
EC9A8DD51124B8160046F5EC /* tnet_nat.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D851124B8160046F5EC /* tnet_nat.h */; };
EC9A8DD61124B8160046F5EC /* tnet_poll.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D861124B8160046F5EC /* tnet_poll.c */; };
EC9A8DD71124B8160046F5EC /* tnet_poll.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D871124B8160046F5EC /* tnet_poll.h */; };
EC9A8DD81124B8160046F5EC /* tnet_proto.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D881124B8160046F5EC /* tnet_proto.h */; };
EC9A8DD91124B8160046F5EC /* tnet_socket.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D891124B8160046F5EC /* tnet_socket.c */; };
EC9A8DDA1124B8160046F5EC /* tnet_socket.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D8A1124B8160046F5EC /* tnet_socket.h */; };
EC9A8DDB1124B8160046F5EC /* tnet_transport.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D8B1124B8160046F5EC /* tnet_transport.c */; };
EC9A8DDC1124B8160046F5EC /* tnet_transport.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D8C1124B8160046F5EC /* tnet_transport.h */; };
EC9A8DDD1124B8160046F5EC /* tnet_transport_poll.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D8D1124B8160046F5EC /* tnet_transport_poll.c */; };
EC9A8DDE1124B8160046F5EC /* tnet_transport_win32.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D8E1124B8160046F5EC /* tnet_transport_win32.c */; };
EC9A8DDF1124B8160046F5EC /* tnet_types.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D8F1124B8160046F5EC /* tnet_types.h */; };
EC9A8DE01124B8160046F5EC /* tnet_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D901124B8160046F5EC /* tnet_utils.c */; };
EC9A8DE11124B8160046F5EC /* tnet_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D911124B8160046F5EC /* tnet_utils.h */; };
EC9A8DE21124B8160046F5EC /* tnet_turn.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D931124B8160046F5EC /* tnet_turn.c */; };
EC9A8DE31124B8160046F5EC /* tnet_turn.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D941124B8160046F5EC /* tnet_turn.h */; };
EC9A8DE41124B8160046F5EC /* tnet_turn_attribute.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D951124B8160046F5EC /* tnet_turn_attribute.c */; };
EC9A8DE51124B8160046F5EC /* tnet_turn_attribute.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D961124B8160046F5EC /* tnet_turn_attribute.h */; };
EC9A8DE61124B8160046F5EC /* tnet_turn_message.c in Sources */ = {isa = PBXBuildFile; fileRef = EC9A8D971124B8160046F5EC /* tnet_turn_message.c */; };
EC9A8DE71124B8160046F5EC /* tnet_turn_message.h in Headers */ = {isa = PBXBuildFile; fileRef = EC9A8D981124B8160046F5EC /* tnet_turn_message.h */; };
ECE5B91610EF65EF00B7EDDD /* tinyNET_config.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B90610EF65EF00B7EDDD /* tinyNET_config.h */; }; ECE5B91610EF65EF00B7EDDD /* tinyNET_config.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B90610EF65EF00B7EDDD /* tinyNET_config.h */; };
ECE5B91710EF65EF00B7EDDD /* tnet.c in Sources */ = {isa = PBXBuildFile; fileRef = ECE5B90710EF65EF00B7EDDD /* tnet.c */; };
ECE5B91810EF65EF00B7EDDD /* tnet.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B90810EF65EF00B7EDDD /* tnet.h */; }; ECE5B91810EF65EF00B7EDDD /* tnet.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B90810EF65EF00B7EDDD /* tnet.h */; };
ECE5B91910EF65EF00B7EDDD /* tnet_auth.c in Sources */ = {isa = PBXBuildFile; fileRef = ECE5B90910EF65EF00B7EDDD /* tnet_auth.c */; };
ECE5B91A10EF65EF00B7EDDD /* tnet_auth.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B90A10EF65EF00B7EDDD /* tnet_auth.h */; }; ECE5B91A10EF65EF00B7EDDD /* tnet_auth.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B90A10EF65EF00B7EDDD /* tnet_auth.h */; };
ECE5B91B10EF65EF00B7EDDD /* tnet_poll.c in Sources */ = {isa = PBXBuildFile; fileRef = ECE5B90B10EF65EF00B7EDDD /* tnet_poll.c */; };
ECE5B91C10EF65EF00B7EDDD /* tnet_poll.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B90C10EF65EF00B7EDDD /* tnet_poll.h */; }; ECE5B91C10EF65EF00B7EDDD /* tnet_poll.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B90C10EF65EF00B7EDDD /* tnet_poll.h */; };
ECE5B91D10EF65F000B7EDDD /* tnet_socket.c in Sources */ = {isa = PBXBuildFile; fileRef = ECE5B90D10EF65EF00B7EDDD /* tnet_socket.c */; };
ECE5B91E10EF65F000B7EDDD /* tnet_socket.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B90E10EF65EF00B7EDDD /* tnet_socket.h */; }; ECE5B91E10EF65F000B7EDDD /* tnet_socket.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B90E10EF65EF00B7EDDD /* tnet_socket.h */; };
ECE5B91F10EF65F000B7EDDD /* tnet_transport.c in Sources */ = {isa = PBXBuildFile; fileRef = ECE5B90F10EF65EF00B7EDDD /* tnet_transport.c */; };
ECE5B92010EF65F000B7EDDD /* tnet_transport.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B91010EF65EF00B7EDDD /* tnet_transport.h */; }; ECE5B92010EF65F000B7EDDD /* tnet_transport.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B91010EF65EF00B7EDDD /* tnet_transport.h */; };
ECE5B92110EF65F000B7EDDD /* tnet_transport_poll.c in Sources */ = {isa = PBXBuildFile; fileRef = ECE5B91110EF65EF00B7EDDD /* tnet_transport_poll.c */; };
ECE5B92210EF65F000B7EDDD /* tnet_transport_win32.c in Sources */ = {isa = PBXBuildFile; fileRef = ECE5B91210EF65EF00B7EDDD /* tnet_transport_win32.c */; };
ECE5B92310EF65F000B7EDDD /* tnet_types.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B91310EF65EF00B7EDDD /* tnet_types.h */; }; ECE5B92310EF65F000B7EDDD /* tnet_types.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B91310EF65EF00B7EDDD /* tnet_types.h */; };
ECE5B92410EF65F000B7EDDD /* tnet_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = ECE5B91410EF65EF00B7EDDD /* tnet_utils.c */; };
ECE5B92510EF65F000B7EDDD /* tnet_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B91510EF65EF00B7EDDD /* tnet_utils.h */; }; ECE5B92510EF65F000B7EDDD /* tnet_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5B91510EF65EF00B7EDDD /* tnet_utils.h */; };
ECE5BA4A10EF6D8500B7EDDD /* tinySAK_config.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5BA1510EF6D8500B7EDDD /* tinySAK_config.h */; }; ECE5BA4A10EF6D8500B7EDDD /* tinySAK_config.h in Headers */ = {isa = PBXBuildFile; fileRef = ECE5BA1510EF6D8500B7EDDD /* tinySAK_config.h */; };
ECE5BA4B10EF6D8500B7EDDD /* tsk.c in Sources */ = {isa = PBXBuildFile; fileRef = ECE5BA1610EF6D8500B7EDDD /* tsk.c */; }; ECE5BA4B10EF6D8500B7EDDD /* tsk.c in Sources */ = {isa = PBXBuildFile; fileRef = ECE5BA1610EF6D8500B7EDDD /* tsk.c */; };
@ -109,21 +183,101 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
D2AAC0630554660B00DB518D /* libtinyNET.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libtinyNET.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; D2AAC0630554660B00DB518D /* libtinyNET.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libtinyNET.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
EC9A8CCD1124B74C0046F5EC /* test_dhcp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = test_dhcp.h; path = ../../tinyNET/test/test_dhcp.h; sourceTree = SOURCE_ROOT; };
EC9A8CCE1124B74C0046F5EC /* test_dhcp6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = test_dhcp6.h; path = ../../tinyNET/test/test_dhcp6.h; sourceTree = SOURCE_ROOT; };
EC9A8CCF1124B74C0046F5EC /* test_dns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = test_dns.h; path = ../../tinyNET/test/test_dns.h; sourceTree = SOURCE_ROOT; };
EC9A8CD01124B74C0046F5EC /* test_ifaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = test_ifaces.h; path = ../../tinyNET/test/test_ifaces.h; sourceTree = SOURCE_ROOT; };
EC9A8CD11124B74C0046F5EC /* test_nat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = test_nat.h; path = ../../tinyNET/test/test_nat.h; sourceTree = SOURCE_ROOT; };
EC9A8CD21124B74C0046F5EC /* test_stun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = test_stun.h; path = ../../tinyNET/test/test_stun.h; sourceTree = SOURCE_ROOT; };
EC9A8D351124B7C90046F5EC /* tsk_ppfcs32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tsk_ppfcs32.c; path = ../../tinySAK/src/tsk_ppfcs32.c; sourceTree = SOURCE_ROOT; };
EC9A8D361124B7C90046F5EC /* tsk_ppfcs32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tsk_ppfcs32.h; path = ../../tinySAK/src/tsk_ppfcs32.h; sourceTree = SOURCE_ROOT; };
EC9A8D371124B7C90046F5EC /* tsk_uuid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tsk_uuid.c; path = ../../tinySAK/src/tsk_uuid.c; sourceTree = SOURCE_ROOT; };
EC9A8D381124B7C90046F5EC /* tsk_uuid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tsk_uuid.h; path = ../../tinySAK/src/tsk_uuid.h; sourceTree = SOURCE_ROOT; };
EC9A8D441124B8160046F5EC /* tnet_dhcp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dhcp.c; sourceTree = "<group>"; };
EC9A8D451124B8160046F5EC /* tnet_dhcp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dhcp.h; sourceTree = "<group>"; };
EC9A8D461124B8160046F5EC /* tnet_dhcp_message.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dhcp_message.c; sourceTree = "<group>"; };
EC9A8D471124B8160046F5EC /* tnet_dhcp_message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dhcp_message.h; sourceTree = "<group>"; };
EC9A8D481124B8160046F5EC /* tnet_dhcp_option.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dhcp_option.c; sourceTree = "<group>"; };
EC9A8D491124B8160046F5EC /* tnet_dhcp_option.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dhcp_option.h; sourceTree = "<group>"; };
EC9A8D4A1124B8160046F5EC /* tnet_dhcp_option_sip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dhcp_option_sip.c; sourceTree = "<group>"; };
EC9A8D4B1124B8160046F5EC /* tnet_dhcp_option_sip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dhcp_option_sip.h; sourceTree = "<group>"; };
EC9A8D4D1124B8160046F5EC /* tnet_dhcp6.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dhcp6.c; sourceTree = "<group>"; };
EC9A8D4E1124B8160046F5EC /* tnet_dhcp6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dhcp6.h; sourceTree = "<group>"; };
EC9A8D4F1124B8160046F5EC /* tnet_dhcp6_duid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dhcp6_duid.c; sourceTree = "<group>"; };
EC9A8D501124B8160046F5EC /* tnet_dhcp6_duid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dhcp6_duid.h; sourceTree = "<group>"; };
EC9A8D511124B8160046F5EC /* tnet_dhcp6_message.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dhcp6_message.c; sourceTree = "<group>"; };
EC9A8D521124B8160046F5EC /* tnet_dhcp6_message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dhcp6_message.h; sourceTree = "<group>"; };
EC9A8D531124B8160046F5EC /* tnet_dhcp6_option.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dhcp6_option.c; sourceTree = "<group>"; };
EC9A8D541124B8160046F5EC /* tnet_dhcp6_option.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dhcp6_option.h; sourceTree = "<group>"; };
EC9A8D561124B8160046F5EC /* tnet_dns.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns.c; sourceTree = "<group>"; };
EC9A8D571124B8160046F5EC /* tnet_dns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns.h; sourceTree = "<group>"; };
EC9A8D581124B8160046F5EC /* tnet_dns_a.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_a.c; sourceTree = "<group>"; };
EC9A8D591124B8160046F5EC /* tnet_dns_a.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_a.h; sourceTree = "<group>"; };
EC9A8D5A1124B8160046F5EC /* tnet_dns_aaaa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_aaaa.c; sourceTree = "<group>"; };
EC9A8D5B1124B8160046F5EC /* tnet_dns_aaaa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_aaaa.h; sourceTree = "<group>"; };
EC9A8D5C1124B8160046F5EC /* tnet_dns_cname.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_cname.c; sourceTree = "<group>"; };
EC9A8D5D1124B8160046F5EC /* tnet_dns_cname.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_cname.h; sourceTree = "<group>"; };
EC9A8D5E1124B8160046F5EC /* tnet_dns_message.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_message.c; sourceTree = "<group>"; };
EC9A8D5F1124B8160046F5EC /* tnet_dns_message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_message.h; sourceTree = "<group>"; };
EC9A8D601124B8160046F5EC /* tnet_dns_mx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_mx.c; sourceTree = "<group>"; };
EC9A8D611124B8160046F5EC /* tnet_dns_mx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_mx.h; sourceTree = "<group>"; };
EC9A8D621124B8160046F5EC /* tnet_dns_naptr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_naptr.c; sourceTree = "<group>"; };
EC9A8D631124B8160046F5EC /* tnet_dns_naptr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_naptr.h; sourceTree = "<group>"; };
EC9A8D641124B8160046F5EC /* tnet_dns_ns.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_ns.c; sourceTree = "<group>"; };
EC9A8D651124B8160046F5EC /* tnet_dns_ns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_ns.h; sourceTree = "<group>"; };
EC9A8D661124B8160046F5EC /* tnet_dns_opt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_opt.c; sourceTree = "<group>"; };
EC9A8D671124B8160046F5EC /* tnet_dns_opt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_opt.h; sourceTree = "<group>"; };
EC9A8D681124B8160046F5EC /* tnet_dns_ptr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_ptr.c; sourceTree = "<group>"; };
EC9A8D691124B8160046F5EC /* tnet_dns_ptr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_ptr.h; sourceTree = "<group>"; };
EC9A8D6A1124B8160046F5EC /* tnet_dns_rr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_rr.c; sourceTree = "<group>"; };
EC9A8D6B1124B8160046F5EC /* tnet_dns_rr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_rr.h; sourceTree = "<group>"; };
EC9A8D6C1124B8160046F5EC /* tnet_dns_soa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_soa.c; sourceTree = "<group>"; };
EC9A8D6D1124B8160046F5EC /* tnet_dns_soa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_soa.h; sourceTree = "<group>"; };
EC9A8D6E1124B8160046F5EC /* tnet_dns_srv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_srv.c; sourceTree = "<group>"; };
EC9A8D6F1124B8160046F5EC /* tnet_dns_srv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_srv.h; sourceTree = "<group>"; };
EC9A8D701124B8160046F5EC /* tnet_dns_txt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_dns_txt.c; sourceTree = "<group>"; };
EC9A8D711124B8160046F5EC /* tnet_dns_txt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_dns_txt.h; sourceTree = "<group>"; };
EC9A8D731124B8160046F5EC /* tnet_ice.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_ice.c; sourceTree = "<group>"; };
EC9A8D741124B8160046F5EC /* tnet_ice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_ice.h; sourceTree = "<group>"; };
EC9A8D781124B8160046F5EC /* tnet_stun.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_stun.c; sourceTree = "<group>"; };
EC9A8D791124B8160046F5EC /* tnet_stun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_stun.h; sourceTree = "<group>"; };
EC9A8D7A1124B8160046F5EC /* tnet_stun_attribute.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_stun_attribute.c; sourceTree = "<group>"; };
EC9A8D7B1124B8160046F5EC /* tnet_stun_attribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_stun_attribute.h; sourceTree = "<group>"; };
EC9A8D7C1124B8160046F5EC /* tnet_stun_message.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_stun_message.c; sourceTree = "<group>"; };
EC9A8D7D1124B8160046F5EC /* tnet_stun_message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_stun_message.h; sourceTree = "<group>"; };
EC9A8D7E1124B8160046F5EC /* tinyNET_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyNET_config.h; sourceTree = "<group>"; };
EC9A8D7F1124B8160046F5EC /* tnet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet.c; sourceTree = "<group>"; };
EC9A8D801124B8160046F5EC /* tnet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet.h; sourceTree = "<group>"; };
EC9A8D811124B8160046F5EC /* tnet_auth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_auth.c; sourceTree = "<group>"; };
EC9A8D821124B8160046F5EC /* tnet_auth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_auth.h; sourceTree = "<group>"; };
EC9A8D831124B8160046F5EC /* tnet_hardwares.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_hardwares.h; sourceTree = "<group>"; };
EC9A8D841124B8160046F5EC /* tnet_nat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_nat.c; sourceTree = "<group>"; };
EC9A8D851124B8160046F5EC /* tnet_nat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_nat.h; sourceTree = "<group>"; };
EC9A8D861124B8160046F5EC /* tnet_poll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_poll.c; sourceTree = "<group>"; };
EC9A8D871124B8160046F5EC /* tnet_poll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_poll.h; sourceTree = "<group>"; };
EC9A8D881124B8160046F5EC /* tnet_proto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_proto.h; sourceTree = "<group>"; };
EC9A8D891124B8160046F5EC /* tnet_socket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_socket.c; sourceTree = "<group>"; };
EC9A8D8A1124B8160046F5EC /* tnet_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_socket.h; sourceTree = "<group>"; };
EC9A8D8B1124B8160046F5EC /* tnet_transport.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_transport.c; sourceTree = "<group>"; };
EC9A8D8C1124B8160046F5EC /* tnet_transport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_transport.h; sourceTree = "<group>"; };
EC9A8D8D1124B8160046F5EC /* tnet_transport_poll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_transport_poll.c; sourceTree = "<group>"; };
EC9A8D8E1124B8160046F5EC /* tnet_transport_win32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_transport_win32.c; sourceTree = "<group>"; };
EC9A8D8F1124B8160046F5EC /* tnet_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_types.h; sourceTree = "<group>"; };
EC9A8D901124B8160046F5EC /* tnet_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_utils.c; sourceTree = "<group>"; };
EC9A8D911124B8160046F5EC /* tnet_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_utils.h; sourceTree = "<group>"; };
EC9A8D931124B8160046F5EC /* tnet_turn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_turn.c; sourceTree = "<group>"; };
EC9A8D941124B8160046F5EC /* tnet_turn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_turn.h; sourceTree = "<group>"; };
EC9A8D951124B8160046F5EC /* tnet_turn_attribute.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_turn_attribute.c; sourceTree = "<group>"; };
EC9A8D961124B8160046F5EC /* tnet_turn_attribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_turn_attribute.h; sourceTree = "<group>"; };
EC9A8D971124B8160046F5EC /* tnet_turn_message.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tnet_turn_message.c; sourceTree = "<group>"; };
EC9A8D981124B8160046F5EC /* tnet_turn_message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tnet_turn_message.h; sourceTree = "<group>"; };
ECE5B90610EF65EF00B7EDDD /* tinyNET_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tinyNET_config.h; path = ../../tinyNET/src/tinyNET_config.h; sourceTree = SOURCE_ROOT; }; ECE5B90610EF65EF00B7EDDD /* tinyNET_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tinyNET_config.h; path = ../../tinyNET/src/tinyNET_config.h; sourceTree = SOURCE_ROOT; };
ECE5B90710EF65EF00B7EDDD /* tnet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tnet.c; path = ../../tinyNET/src/tnet.c; sourceTree = SOURCE_ROOT; };
ECE5B90810EF65EF00B7EDDD /* tnet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet.h; path = ../../tinyNET/src/tnet.h; sourceTree = SOURCE_ROOT; }; ECE5B90810EF65EF00B7EDDD /* tnet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet.h; path = ../../tinyNET/src/tnet.h; sourceTree = SOURCE_ROOT; };
ECE5B90910EF65EF00B7EDDD /* tnet_auth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tnet_auth.c; path = ../../tinyNET/src/tnet_auth.c; sourceTree = SOURCE_ROOT; };
ECE5B90A10EF65EF00B7EDDD /* tnet_auth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_auth.h; path = ../../tinyNET/src/tnet_auth.h; sourceTree = SOURCE_ROOT; }; ECE5B90A10EF65EF00B7EDDD /* tnet_auth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_auth.h; path = ../../tinyNET/src/tnet_auth.h; sourceTree = SOURCE_ROOT; };
ECE5B90B10EF65EF00B7EDDD /* tnet_poll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tnet_poll.c; path = ../../tinyNET/src/tnet_poll.c; sourceTree = SOURCE_ROOT; };
ECE5B90C10EF65EF00B7EDDD /* tnet_poll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_poll.h; path = ../../tinyNET/src/tnet_poll.h; sourceTree = SOURCE_ROOT; }; ECE5B90C10EF65EF00B7EDDD /* tnet_poll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_poll.h; path = ../../tinyNET/src/tnet_poll.h; sourceTree = SOURCE_ROOT; };
ECE5B90D10EF65EF00B7EDDD /* tnet_socket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tnet_socket.c; path = ../../tinyNET/src/tnet_socket.c; sourceTree = SOURCE_ROOT; };
ECE5B90E10EF65EF00B7EDDD /* tnet_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_socket.h; path = ../../tinyNET/src/tnet_socket.h; sourceTree = SOURCE_ROOT; }; ECE5B90E10EF65EF00B7EDDD /* tnet_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_socket.h; path = ../../tinyNET/src/tnet_socket.h; sourceTree = SOURCE_ROOT; };
ECE5B90F10EF65EF00B7EDDD /* tnet_transport.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tnet_transport.c; path = ../../tinyNET/src/tnet_transport.c; sourceTree = SOURCE_ROOT; };
ECE5B91010EF65EF00B7EDDD /* tnet_transport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_transport.h; path = ../../tinyNET/src/tnet_transport.h; sourceTree = SOURCE_ROOT; }; ECE5B91010EF65EF00B7EDDD /* tnet_transport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_transport.h; path = ../../tinyNET/src/tnet_transport.h; sourceTree = SOURCE_ROOT; };
ECE5B91110EF65EF00B7EDDD /* tnet_transport_poll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tnet_transport_poll.c; path = ../../tinyNET/src/tnet_transport_poll.c; sourceTree = SOURCE_ROOT; };
ECE5B91210EF65EF00B7EDDD /* tnet_transport_win32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tnet_transport_win32.c; path = ../../tinyNET/src/tnet_transport_win32.c; sourceTree = SOURCE_ROOT; };
ECE5B91310EF65EF00B7EDDD /* tnet_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_types.h; path = ../../tinyNET/src/tnet_types.h; sourceTree = SOURCE_ROOT; }; ECE5B91310EF65EF00B7EDDD /* tnet_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_types.h; path = ../../tinyNET/src/tnet_types.h; sourceTree = SOURCE_ROOT; };
ECE5B91410EF65EF00B7EDDD /* tnet_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tnet_utils.c; path = ../../tinyNET/src/tnet_utils.c; sourceTree = SOURCE_ROOT; };
ECE5B91510EF65EF00B7EDDD /* tnet_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_utils.h; path = ../../tinyNET/src/tnet_utils.h; sourceTree = SOURCE_ROOT; }; ECE5B91510EF65EF00B7EDDD /* tnet_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tnet_utils.h; path = ../../tinyNET/src/tnet_utils.h; sourceTree = SOURCE_ROOT; };
ECE5B98410EF6B6F00B7EDDD /* libtinySAK.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libtinySAK.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; ECE5B98410EF6B6F00B7EDDD /* libtinySAK.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libtinySAK.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
ECE5BA1510EF6D8500B7EDDD /* tinySAK_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tinySAK_config.h; path = ../../tinySAK/src/tinySAK_config.h; sourceTree = SOURCE_ROOT; }; ECE5BA1510EF6D8500B7EDDD /* tinySAK_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tinySAK_config.h; path = ../../tinySAK/src/tinySAK_config.h; sourceTree = SOURCE_ROOT; };
@ -221,30 +375,15 @@
08FB7794FE84155DC02AAC07 /* tinyNET */ = { 08FB7794FE84155DC02AAC07 /* tinyNET */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
EC9A8D421124B8160046F5EC /* src */,
ECE5BA9810EF6E0600B7EDDD /* test */, ECE5BA9810EF6E0600B7EDDD /* test */,
ECE5BA1410EF6D5500B7EDDD /* tinySAK */, ECE5BA1410EF6D5500B7EDDD /* tinySAK */,
ECE5B90310EF65C200B7EDDD /* include */, ECE5B90310EF65C200B7EDDD /* include */,
08FB7795FE84155DC02AAC07 /* Source */,
1AB674ADFE9D54B511CA2CBB /* Products */, 1AB674ADFE9D54B511CA2CBB /* Products */,
); );
name = tinyNET; name = tinyNET;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
ECE5B90710EF65EF00B7EDDD /* tnet.c */,
ECE5B90910EF65EF00B7EDDD /* tnet_auth.c */,
ECE5B90B10EF65EF00B7EDDD /* tnet_poll.c */,
ECE5B90D10EF65EF00B7EDDD /* tnet_socket.c */,
ECE5B90F10EF65EF00B7EDDD /* tnet_transport.c */,
ECE5B91110EF65EF00B7EDDD /* tnet_transport_poll.c */,
ECE5B91210EF65EF00B7EDDD /* tnet_transport_win32.c */,
ECE5B91410EF65EF00B7EDDD /* tnet_utils.c */,
);
name = Source;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = { 1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -255,6 +394,148 @@
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
EC9A8D421124B8160046F5EC /* src */ = {
isa = PBXGroup;
children = (
EC9A8D431124B8160046F5EC /* dhcp */,
EC9A8D4C1124B8160046F5EC /* dhcp6 */,
EC9A8D551124B8160046F5EC /* dns */,
EC9A8D721124B8160046F5EC /* ice */,
EC9A8D761124B8160046F5EC /* parsers */,
EC9A8D771124B8160046F5EC /* stun */,
EC9A8D7E1124B8160046F5EC /* tinyNET_config.h */,
EC9A8D7F1124B8160046F5EC /* tnet.c */,
EC9A8D801124B8160046F5EC /* tnet.h */,
EC9A8D811124B8160046F5EC /* tnet_auth.c */,
EC9A8D821124B8160046F5EC /* tnet_auth.h */,
EC9A8D831124B8160046F5EC /* tnet_hardwares.h */,
EC9A8D841124B8160046F5EC /* tnet_nat.c */,
EC9A8D851124B8160046F5EC /* tnet_nat.h */,
EC9A8D861124B8160046F5EC /* tnet_poll.c */,
EC9A8D871124B8160046F5EC /* tnet_poll.h */,
EC9A8D881124B8160046F5EC /* tnet_proto.h */,
EC9A8D891124B8160046F5EC /* tnet_socket.c */,
EC9A8D8A1124B8160046F5EC /* tnet_socket.h */,
EC9A8D8B1124B8160046F5EC /* tnet_transport.c */,
EC9A8D8C1124B8160046F5EC /* tnet_transport.h */,
EC9A8D8D1124B8160046F5EC /* tnet_transport_poll.c */,
EC9A8D8E1124B8160046F5EC /* tnet_transport_win32.c */,
EC9A8D8F1124B8160046F5EC /* tnet_types.h */,
EC9A8D901124B8160046F5EC /* tnet_utils.c */,
EC9A8D911124B8160046F5EC /* tnet_utils.h */,
EC9A8D921124B8160046F5EC /* turn */,
);
name = src;
path = ../../tinyNET/src;
sourceTree = SOURCE_ROOT;
};
EC9A8D431124B8160046F5EC /* dhcp */ = {
isa = PBXGroup;
children = (
EC9A8D441124B8160046F5EC /* tnet_dhcp.c */,
EC9A8D451124B8160046F5EC /* tnet_dhcp.h */,
EC9A8D461124B8160046F5EC /* tnet_dhcp_message.c */,
EC9A8D471124B8160046F5EC /* tnet_dhcp_message.h */,
EC9A8D481124B8160046F5EC /* tnet_dhcp_option.c */,
EC9A8D491124B8160046F5EC /* tnet_dhcp_option.h */,
EC9A8D4A1124B8160046F5EC /* tnet_dhcp_option_sip.c */,
EC9A8D4B1124B8160046F5EC /* tnet_dhcp_option_sip.h */,
);
path = dhcp;
sourceTree = "<group>";
};
EC9A8D4C1124B8160046F5EC /* dhcp6 */ = {
isa = PBXGroup;
children = (
EC9A8D4D1124B8160046F5EC /* tnet_dhcp6.c */,
EC9A8D4E1124B8160046F5EC /* tnet_dhcp6.h */,
EC9A8D4F1124B8160046F5EC /* tnet_dhcp6_duid.c */,
EC9A8D501124B8160046F5EC /* tnet_dhcp6_duid.h */,
EC9A8D511124B8160046F5EC /* tnet_dhcp6_message.c */,
EC9A8D521124B8160046F5EC /* tnet_dhcp6_message.h */,
EC9A8D531124B8160046F5EC /* tnet_dhcp6_option.c */,
EC9A8D541124B8160046F5EC /* tnet_dhcp6_option.h */,
);
path = dhcp6;
sourceTree = "<group>";
};
EC9A8D551124B8160046F5EC /* dns */ = {
isa = PBXGroup;
children = (
EC9A8D561124B8160046F5EC /* tnet_dns.c */,
EC9A8D571124B8160046F5EC /* tnet_dns.h */,
EC9A8D581124B8160046F5EC /* tnet_dns_a.c */,
EC9A8D591124B8160046F5EC /* tnet_dns_a.h */,
EC9A8D5A1124B8160046F5EC /* tnet_dns_aaaa.c */,
EC9A8D5B1124B8160046F5EC /* tnet_dns_aaaa.h */,
EC9A8D5C1124B8160046F5EC /* tnet_dns_cname.c */,
EC9A8D5D1124B8160046F5EC /* tnet_dns_cname.h */,
EC9A8D5E1124B8160046F5EC /* tnet_dns_message.c */,
EC9A8D5F1124B8160046F5EC /* tnet_dns_message.h */,
EC9A8D601124B8160046F5EC /* tnet_dns_mx.c */,
EC9A8D611124B8160046F5EC /* tnet_dns_mx.h */,
EC9A8D621124B8160046F5EC /* tnet_dns_naptr.c */,
EC9A8D631124B8160046F5EC /* tnet_dns_naptr.h */,
EC9A8D641124B8160046F5EC /* tnet_dns_ns.c */,
EC9A8D651124B8160046F5EC /* tnet_dns_ns.h */,
EC9A8D661124B8160046F5EC /* tnet_dns_opt.c */,
EC9A8D671124B8160046F5EC /* tnet_dns_opt.h */,
EC9A8D681124B8160046F5EC /* tnet_dns_ptr.c */,
EC9A8D691124B8160046F5EC /* tnet_dns_ptr.h */,
EC9A8D6A1124B8160046F5EC /* tnet_dns_rr.c */,
EC9A8D6B1124B8160046F5EC /* tnet_dns_rr.h */,
EC9A8D6C1124B8160046F5EC /* tnet_dns_soa.c */,
EC9A8D6D1124B8160046F5EC /* tnet_dns_soa.h */,
EC9A8D6E1124B8160046F5EC /* tnet_dns_srv.c */,
EC9A8D6F1124B8160046F5EC /* tnet_dns_srv.h */,
EC9A8D701124B8160046F5EC /* tnet_dns_txt.c */,
EC9A8D711124B8160046F5EC /* tnet_dns_txt.h */,
);
path = dns;
sourceTree = "<group>";
};
EC9A8D721124B8160046F5EC /* ice */ = {
isa = PBXGroup;
children = (
EC9A8D731124B8160046F5EC /* tnet_ice.c */,
EC9A8D741124B8160046F5EC /* tnet_ice.h */,
);
path = ice;
sourceTree = "<group>";
};
EC9A8D761124B8160046F5EC /* parsers */ = {
isa = PBXGroup;
children = (
);
path = parsers;
sourceTree = "<group>";
};
EC9A8D771124B8160046F5EC /* stun */ = {
isa = PBXGroup;
children = (
EC9A8D781124B8160046F5EC /* tnet_stun.c */,
EC9A8D791124B8160046F5EC /* tnet_stun.h */,
EC9A8D7A1124B8160046F5EC /* tnet_stun_attribute.c */,
EC9A8D7B1124B8160046F5EC /* tnet_stun_attribute.h */,
EC9A8D7C1124B8160046F5EC /* tnet_stun_message.c */,
EC9A8D7D1124B8160046F5EC /* tnet_stun_message.h */,
);
path = stun;
sourceTree = "<group>";
};
EC9A8D921124B8160046F5EC /* turn */ = {
isa = PBXGroup;
children = (
EC9A8D931124B8160046F5EC /* tnet_turn.c */,
EC9A8D941124B8160046F5EC /* tnet_turn.h */,
EC9A8D951124B8160046F5EC /* tnet_turn_attribute.c */,
EC9A8D961124B8160046F5EC /* tnet_turn_attribute.h */,
EC9A8D971124B8160046F5EC /* tnet_turn_message.c */,
EC9A8D981124B8160046F5EC /* tnet_turn_message.h */,
);
path = turn;
sourceTree = "<group>";
};
ECE5B90310EF65C200B7EDDD /* include */ = { ECE5B90310EF65C200B7EDDD /* include */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -273,6 +554,10 @@
ECE5BA1410EF6D5500B7EDDD /* tinySAK */ = { ECE5BA1410EF6D5500B7EDDD /* tinySAK */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
EC9A8D351124B7C90046F5EC /* tsk_ppfcs32.c */,
EC9A8D361124B7C90046F5EC /* tsk_ppfcs32.h */,
EC9A8D371124B7C90046F5EC /* tsk_uuid.c */,
EC9A8D381124B7C90046F5EC /* tsk_uuid.h */,
ECE5BA1510EF6D8500B7EDDD /* tinySAK_config.h */, ECE5BA1510EF6D8500B7EDDD /* tinySAK_config.h */,
ECE5BA1610EF6D8500B7EDDD /* tsk.c */, ECE5BA1610EF6D8500B7EDDD /* tsk.c */,
ECE5BA1710EF6D8500B7EDDD /* tsk.h */, ECE5BA1710EF6D8500B7EDDD /* tsk.h */,
@ -333,6 +618,12 @@
ECE5BA9810EF6E0600B7EDDD /* test */ = { ECE5BA9810EF6E0600B7EDDD /* test */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
EC9A8CCD1124B74C0046F5EC /* test_dhcp.h */,
EC9A8CCE1124B74C0046F5EC /* test_dhcp6.h */,
EC9A8CCF1124B74C0046F5EC /* test_dns.h */,
EC9A8CD01124B74C0046F5EC /* test_ifaces.h */,
EC9A8CD11124B74C0046F5EC /* test_nat.h */,
EC9A8CD21124B74C0046F5EC /* test_stun.h */,
ECE5BAA710EF6E4800B7EDDD /* stdafx.c */, ECE5BAA710EF6E4800B7EDDD /* stdafx.c */,
ECE5BAA810EF6E4800B7EDDD /* stdafx.h */, ECE5BAA810EF6E4800B7EDDD /* stdafx.h */,
ECE5BAA910EF6E4800B7EDDD /* targetver.h */, ECE5BAA910EF6E4800B7EDDD /* targetver.h */,
@ -360,6 +651,46 @@
ECE5B92010EF65F000B7EDDD /* tnet_transport.h in Headers */, ECE5B92010EF65F000B7EDDD /* tnet_transport.h in Headers */,
ECE5B92310EF65F000B7EDDD /* tnet_types.h in Headers */, ECE5B92310EF65F000B7EDDD /* tnet_types.h in Headers */,
ECE5B92510EF65F000B7EDDD /* tnet_utils.h in Headers */, ECE5B92510EF65F000B7EDDD /* tnet_utils.h in Headers */,
EC9A8D9A1124B8160046F5EC /* tnet_dhcp.h in Headers */,
EC9A8D9C1124B8160046F5EC /* tnet_dhcp_message.h in Headers */,
EC9A8D9E1124B8160046F5EC /* tnet_dhcp_option.h in Headers */,
EC9A8DA01124B8160046F5EC /* tnet_dhcp_option_sip.h in Headers */,
EC9A8DA21124B8160046F5EC /* tnet_dhcp6.h in Headers */,
EC9A8DA41124B8160046F5EC /* tnet_dhcp6_duid.h in Headers */,
EC9A8DA61124B8160046F5EC /* tnet_dhcp6_message.h in Headers */,
EC9A8DA81124B8160046F5EC /* tnet_dhcp6_option.h in Headers */,
EC9A8DAA1124B8160046F5EC /* tnet_dns.h in Headers */,
EC9A8DAC1124B8160046F5EC /* tnet_dns_a.h in Headers */,
EC9A8DAE1124B8160046F5EC /* tnet_dns_aaaa.h in Headers */,
EC9A8DB01124B8160046F5EC /* tnet_dns_cname.h in Headers */,
EC9A8DB21124B8160046F5EC /* tnet_dns_message.h in Headers */,
EC9A8DB41124B8160046F5EC /* tnet_dns_mx.h in Headers */,
EC9A8DB61124B8160046F5EC /* tnet_dns_naptr.h in Headers */,
EC9A8DB81124B8160046F5EC /* tnet_dns_ns.h in Headers */,
EC9A8DBA1124B8160046F5EC /* tnet_dns_opt.h in Headers */,
EC9A8DBC1124B8160046F5EC /* tnet_dns_ptr.h in Headers */,
EC9A8DBE1124B8160046F5EC /* tnet_dns_rr.h in Headers */,
EC9A8DC01124B8160046F5EC /* tnet_dns_soa.h in Headers */,
EC9A8DC21124B8160046F5EC /* tnet_dns_srv.h in Headers */,
EC9A8DC41124B8160046F5EC /* tnet_dns_txt.h in Headers */,
EC9A8DC61124B8160046F5EC /* tnet_ice.h in Headers */,
EC9A8DC91124B8160046F5EC /* tnet_stun.h in Headers */,
EC9A8DCB1124B8160046F5EC /* tnet_stun_attribute.h in Headers */,
EC9A8DCD1124B8160046F5EC /* tnet_stun_message.h in Headers */,
EC9A8DCE1124B8160046F5EC /* tinyNET_config.h in Headers */,
EC9A8DD01124B8160046F5EC /* tnet.h in Headers */,
EC9A8DD21124B8160046F5EC /* tnet_auth.h in Headers */,
EC9A8DD31124B8160046F5EC /* tnet_hardwares.h in Headers */,
EC9A8DD51124B8160046F5EC /* tnet_nat.h in Headers */,
EC9A8DD71124B8160046F5EC /* tnet_poll.h in Headers */,
EC9A8DD81124B8160046F5EC /* tnet_proto.h in Headers */,
EC9A8DDA1124B8160046F5EC /* tnet_socket.h in Headers */,
EC9A8DDC1124B8160046F5EC /* tnet_transport.h in Headers */,
EC9A8DDF1124B8160046F5EC /* tnet_types.h in Headers */,
EC9A8DE11124B8160046F5EC /* tnet_utils.h in Headers */,
EC9A8DE31124B8160046F5EC /* tnet_turn.h in Headers */,
EC9A8DE51124B8160046F5EC /* tnet_turn_attribute.h in Headers */,
EC9A8DE71124B8160046F5EC /* tnet_turn_message.h in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -395,6 +726,8 @@
ECE5BA7A10EF6D8500B7EDDD /* tsk_timer.h in Headers */, ECE5BA7A10EF6D8500B7EDDD /* tsk_timer.h in Headers */,
ECE5BA7C10EF6D8500B7EDDD /* tsk_url.h in Headers */, ECE5BA7C10EF6D8500B7EDDD /* tsk_url.h in Headers */,
ECE5BA7E10EF6D8500B7EDDD /* tsk_xml.h in Headers */, ECE5BA7E10EF6D8500B7EDDD /* tsk_xml.h in Headers */,
EC9A8D3A1124B7C90046F5EC /* tsk_ppfcs32.h in Headers */,
EC9A8D3C1124B7C90046F5EC /* tsk_uuid.h in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -478,14 +811,44 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
ECE5B91710EF65EF00B7EDDD /* tnet.c in Sources */, EC9A8D991124B8160046F5EC /* tnet_dhcp.c in Sources */,
ECE5B91910EF65EF00B7EDDD /* tnet_auth.c in Sources */, EC9A8D9B1124B8160046F5EC /* tnet_dhcp_message.c in Sources */,
ECE5B91B10EF65EF00B7EDDD /* tnet_poll.c in Sources */, EC9A8D9D1124B8160046F5EC /* tnet_dhcp_option.c in Sources */,
ECE5B91D10EF65F000B7EDDD /* tnet_socket.c in Sources */, EC9A8D9F1124B8160046F5EC /* tnet_dhcp_option_sip.c in Sources */,
ECE5B91F10EF65F000B7EDDD /* tnet_transport.c in Sources */, EC9A8DA11124B8160046F5EC /* tnet_dhcp6.c in Sources */,
ECE5B92110EF65F000B7EDDD /* tnet_transport_poll.c in Sources */, EC9A8DA31124B8160046F5EC /* tnet_dhcp6_duid.c in Sources */,
ECE5B92210EF65F000B7EDDD /* tnet_transport_win32.c in Sources */, EC9A8DA51124B8160046F5EC /* tnet_dhcp6_message.c in Sources */,
ECE5B92410EF65F000B7EDDD /* tnet_utils.c in Sources */, EC9A8DA71124B8160046F5EC /* tnet_dhcp6_option.c in Sources */,
EC9A8DA91124B8160046F5EC /* tnet_dns.c in Sources */,
EC9A8DAB1124B8160046F5EC /* tnet_dns_a.c in Sources */,
EC9A8DAD1124B8160046F5EC /* tnet_dns_aaaa.c in Sources */,
EC9A8DAF1124B8160046F5EC /* tnet_dns_cname.c in Sources */,
EC9A8DB11124B8160046F5EC /* tnet_dns_message.c in Sources */,
EC9A8DB31124B8160046F5EC /* tnet_dns_mx.c in Sources */,
EC9A8DB51124B8160046F5EC /* tnet_dns_naptr.c in Sources */,
EC9A8DB71124B8160046F5EC /* tnet_dns_ns.c in Sources */,
EC9A8DB91124B8160046F5EC /* tnet_dns_opt.c in Sources */,
EC9A8DBB1124B8160046F5EC /* tnet_dns_ptr.c in Sources */,
EC9A8DBD1124B8160046F5EC /* tnet_dns_rr.c in Sources */,
EC9A8DBF1124B8160046F5EC /* tnet_dns_soa.c in Sources */,
EC9A8DC11124B8160046F5EC /* tnet_dns_srv.c in Sources */,
EC9A8DC31124B8160046F5EC /* tnet_dns_txt.c in Sources */,
EC9A8DC51124B8160046F5EC /* tnet_ice.c in Sources */,
EC9A8DC81124B8160046F5EC /* tnet_stun.c in Sources */,
EC9A8DCA1124B8160046F5EC /* tnet_stun_attribute.c in Sources */,
EC9A8DCC1124B8160046F5EC /* tnet_stun_message.c in Sources */,
EC9A8DCF1124B8160046F5EC /* tnet.c in Sources */,
EC9A8DD11124B8160046F5EC /* tnet_auth.c in Sources */,
EC9A8DD41124B8160046F5EC /* tnet_nat.c in Sources */,
EC9A8DD61124B8160046F5EC /* tnet_poll.c in Sources */,
EC9A8DD91124B8160046F5EC /* tnet_socket.c in Sources */,
EC9A8DDB1124B8160046F5EC /* tnet_transport.c in Sources */,
EC9A8DDD1124B8160046F5EC /* tnet_transport_poll.c in Sources */,
EC9A8DDE1124B8160046F5EC /* tnet_transport_win32.c in Sources */,
EC9A8DE01124B8160046F5EC /* tnet_utils.c in Sources */,
EC9A8DE21124B8160046F5EC /* tnet_turn.c in Sources */,
EC9A8DE41124B8160046F5EC /* tnet_turn_attribute.c in Sources */,
EC9A8DE61124B8160046F5EC /* tnet_turn_message.c in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -518,6 +881,8 @@
ECE5BA7910EF6D8500B7EDDD /* tsk_timer.c in Sources */, ECE5BA7910EF6D8500B7EDDD /* tsk_timer.c in Sources */,
ECE5BA7B10EF6D8500B7EDDD /* tsk_url.c in Sources */, ECE5BA7B10EF6D8500B7EDDD /* tsk_url.c in Sources */,
ECE5BA7D10EF6D8500B7EDDD /* tsk_xml.c in Sources */, ECE5BA7D10EF6D8500B7EDDD /* tsk_xml.c in Sources */,
EC9A8D391124B7C90046F5EC /* tsk_ppfcs32.c in Sources */,
EC9A8D3B1124B7C90046F5EC /* tsk_uuid.c in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -561,6 +926,7 @@
GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5; GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0; GCC_OPTIMIZATION_LEVEL = 0;
HEADER_SEARCH_PATHS = ../../tinyNET/src;
INSTALL_PATH = /usr/local/lib; INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = tinyNET; PRODUCT_NAME = tinyNET;
}; };
@ -649,6 +1015,7 @@
GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5; GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0; GCC_OPTIMIZATION_LEVEL = 0;
HEADER_SEARCH_PATHS = ../../tinyNET/src;
INSTALL_PATH = /usr/local/bin; INSTALL_PATH = /usr/local/bin;
PREBINDING = NO; PREBINDING = NO;
PRODUCT_NAME = test; PRODUCT_NAME = test;